main run.sh
Eric Bower  ·  2026-08-17
 1#!/usr/bin/env bash
 2
 3# Continuously subscribe to build events and feed them to pici runner.
 4# Reconnects immediately after each event, delays only on connection errors.
 5# Usage: ./run.sh
 6
 7while true; do
 8  echo "waiting for pici event ..."
 9  event=$(ssh pipe sub pici 2>/dev/null)
10  if [ -n "$event" ]; then
11      echo "$event" | pici runner
12  else
13      echo "could not connect to pipe, waiting 5s..."
14      sleep 5
15  fi
16done