Commit e3aec66

Eric Bower  ·  2026-05-06 20:34:07 -0400 EDT
parent b95ae48
refactor: name is now `pici`
4 files changed,  +10, -8
M go.mod
A .gitignore
+1, -0
1@@ -0,0 +1 @@
2+ci
A event.json
+1, -0
1@@ -0,0 +1 @@
2+{"type":"git.push","name":"pico","workspace":"/home/erock/dev/pico/"}
M go.mod
+1, -1
1@@ -1,4 +1,4 @@
2-module github.com/picosh/ci
3+module github.com/picosh/pici
4 
5 go 1.26.2
6 
M main.go
+7, -7
 1@@ -59,7 +59,7 @@ func NewCfg() *Cfg {
 2 	var structured bool
 3 	flag.StringVar(&keyLoc, "pk", "", "ssh private key used to authenticate with pico services")
 4 	flag.StringVar(&certLoc, "ck", "", "ssh certificate public key used to authenticate with pico services (only required if using ssh certificates)")
 5-	flag.StringVar(&artifactDir, "artifact-dir", "/tmp/pico-ci-artifacts", "local directory to stage artifacts")
 6+	flag.StringVar(&artifactDir, "artifact-dir", "/tmp/pici-artifacts", "local directory to stage artifacts")
 7 	flag.StringVar(&event, "event", "", "event JSON to run (alternative to reading from stdin)")
 8 	flag.DurationVar(&monitorInterval, "monitor-interval", 5*time.Second, "interval for monitoring zmx sessions")
 9 	flag.StringVar(&logLevel, "log-level", "info", "log level: debug, info, warn, error")
10@@ -195,7 +195,7 @@ type WorkspaceRsync struct {
11 }
12 
13 func (w *WorkspaceRsync) Setup() error {
14-	tempDir, err := os.MkdirTemp("", "pico-ci-*")
15+	tempDir, err := os.MkdirTemp("", "pici-*")
16 	if err != nil {
17 		return err
18 	}
19@@ -207,7 +207,7 @@ func (w *WorkspaceRsync) Setup() error {
20 	var cmd *exec.Cmd
21 	if w.Cfg.KeyLocation != "" {
22 		sshcmd := fmt.Sprintf(
23-			"-i %s -o IdentitiesOnly=yes -o CertificateFile %s",
24+			"-F ~/.ssh/config -i %s -o IdentitiesOnly=yes -o CertificateFile %s",
25 			w.Cfg.KeyLocation,
26 			w.Cfg.CertificateLocation,
27 		)
28@@ -359,9 +359,9 @@ func eventHandler(cfg *Cfg, eventData *Event) error {
29 // writes status as JSONL to stdout, stages artifacts, and syncs to destination.
30 // Logs go to stderr. Compose with shell tools to route status:
31 //
32-//	pico-ci monitor | ssh pipe.pico.sh "pub build.status -b=false"
33-//	pico-ci monitor | while read -r line; do curl -sd"$line" $WEBHOOK; done
34-//	pico-ci monitor > status.jsonl
35+//	pici monitor | ssh pipe.pico.sh "pub build.status -b=false"
36+//	pici monitor | while read -r line; do curl -sd"$line" $WEBHOOK; done
37+//	pici monitor > status.jsonl
38 func runMonitor(cfg *Cfg) error {
39 	log := cfg.Logger.With("cmd", "monitor")
40 
41@@ -789,7 +789,7 @@ func syncArtifacts(cfg *Cfg, log *slog.Logger) error {
42 			}
43 			log.Debug("syncing artifacts", "repo", entry.Name(), "job_id", repoEntry.Name(), "dest", event.ArtifactDest)
44 			sshArgs := fmt.Sprintf(
45-				"-i %s -o IdentitiesOnly=yes -o CertificateFile %s",
46+				"-F ~/.ssh/config -i %s -o IdentitiesOnly=yes -o CertificateFile %s",
47 				cfg.KeyLocation,
48 				cfg.CertificateLocation,
49 			)