Commit e3aec66
Eric Bower
·
2026-05-06 20:34:07 -0400 EDT
parent b95ae48
refactor: name is now `pici`
4 files changed,
+10,
-8
+1,
-0
| ... | ... | @@ -0,0 +1 @@ | |
| 1 | + | ci |
+1,
-0
| ... | ... | @@ -0,0 +1 @@ | |
| 1 | + | {"type":"git.push","name":"pico","workspace":"/home/erock/dev/pico/"} |
M
go.mod
+1,
-1
| ... | ... | @@ -1,4 +1,4 @@ | |
| 1 | - | module github.com/picosh/ci | |
| 1 | + | module github.com/picosh/pici | |
| 2 | 2 | ||
| 3 | 3 | go 1.26.2 | |
| 4 | 4 |
M
main.go
+7,
-7
| ... | ... | @@ -59,7 +59,7 @@ func NewCfg() *Cfg { | |
| 59 | 59 | var structured bool | |
| 60 | 60 | flag.StringVar(&keyLoc, "pk", "", "ssh private key used to authenticate with pico services") | |
| 61 | 61 | flag.StringVar(&certLoc, "ck", "", "ssh certificate public key used to authenticate with pico services (only required if using ssh certificates)") | |
| 62 | - | flag.StringVar(&artifactDir, "artifact-dir", "/tmp/pico-ci-artifacts", "local directory to stage artifacts") | |
| 62 | + | flag.StringVar(&artifactDir, "artifact-dir", "/tmp/pici-artifacts", "local directory to stage artifacts") | |
| 63 | 63 | flag.StringVar(&event, "event", "", "event JSON to run (alternative to reading from stdin)") | |
| 64 | 64 | flag.DurationVar(&monitorInterval, "monitor-interval", 5*time.Second, "interval for monitoring zmx sessions") | |
| 65 | 65 | flag.StringVar(&logLevel, "log-level", "info", "log level: debug, info, warn, error") |
| ... | ... | @@ -195,7 +195,7 @@ type WorkspaceRsync struct { | |
| 195 | 195 | } | |
| 196 | 196 | ||
| 197 | 197 | func (w *WorkspaceRsync) Setup() error { | |
| 198 | - | tempDir, err := os.MkdirTemp("", "pico-ci-*") | |
| 198 | + | tempDir, err := os.MkdirTemp("", "pici-*") | |
| 199 | 199 | if err != nil { | |
| 200 | 200 | return err | |
| 201 | 201 | } |
| ... | ... | @@ -207,7 +207,7 @@ func (w *WorkspaceRsync) Setup() error { | |
| 207 | 207 | var cmd *exec.Cmd | |
| 208 | 208 | if w.Cfg.KeyLocation != "" { | |
| 209 | 209 | sshcmd := fmt.Sprintf( | |
| 210 | - | "-i %s -o IdentitiesOnly=yes -o CertificateFile %s", | |
| 210 | + | "-F ~/.ssh/config -i %s -o IdentitiesOnly=yes -o CertificateFile %s", | |
| 211 | 211 | w.Cfg.KeyLocation, | |
| 212 | 212 | w.Cfg.CertificateLocation, | |
| 213 | 213 | ) |
| ... | ... | @@ -359,9 +359,9 @@ func eventHandler(cfg *Cfg, eventData *Event) error { | |
| 359 | 359 | // writes status as JSONL to stdout, stages artifacts, and syncs to destination. | |
| 360 | 360 | // Logs go to stderr. Compose with shell tools to route status: | |
| 361 | 361 | // | |
| 362 | - | // pico-ci monitor | ssh pipe.pico.sh "pub build.status -b=false" | |
| 363 | - | // pico-ci monitor | while read -r line; do curl -sd"$line" $WEBHOOK; done | |
| 364 | - | // pico-ci monitor > status.jsonl | |
| 362 | + | // pici monitor | ssh pipe.pico.sh "pub build.status -b=false" | |
| 363 | + | // pici monitor | while read -r line; do curl -sd"$line" $WEBHOOK; done | |
| 364 | + | // pici monitor > status.jsonl | |
| 365 | 365 | func runMonitor(cfg *Cfg) error { | |
| 366 | 366 | log := cfg.Logger.With("cmd", "monitor") | |
| 367 | 367 |
| ... | ... | @@ -789,7 +789,7 @@ func syncArtifacts(cfg *Cfg, log *slog.Logger) error { | |
| 789 | 789 | } | |
| 790 | 790 | log.Debug("syncing artifacts", "repo", entry.Name(), "job_id", repoEntry.Name(), "dest", event.ArtifactDest) | |
| 791 | 791 | sshArgs := fmt.Sprintf( | |
| 792 | - | "-i %s -o IdentitiesOnly=yes -o CertificateFile %s", | |
| 792 | + | "-F ~/.ssh/config -i %s -o IdentitiesOnly=yes -o CertificateFile %s", | |
| 793 | 793 | cfg.KeyLocation, | |
| 794 | 794 | cfg.CertificateLocation, | |
| 795 | 795 | ) |