diff --git a/dev2/README.md b/dev2/README.md index af81504..2fb7879 100644 --- a/dev2/README.md +++ b/dev2/README.md @@ -212,7 +212,9 @@ does what it did from the box: for every `~/www//deploy.env` whose `REPO` private repo, `git ls-remote HEAD` with the site's deploy key, and when that is not `.deploy-state`'s `DEPLOYED_SHA`, `deploy-app.sh ` in the background (through deploy-gate, so 3 at a time). A failed sha is not retried until a newer -commit lands. Public repos are skipped: their workflow still runs free. +commit lands. Public repos are skipped: their workflow still runs free. A step the +workflow ran after the deploy goes in an executable `~/www//post-deploy.sh` +(weedforcrypto.com: restart its host-side worker). ``` deploy-poll.sh --status site, deployed, tip, current|behind|failed|unreachable diff --git a/dev2/deploy-poll.sh b/dev2/deploy-poll.sh index a856195..47b00cb 100755 --- a/dev2/deploy-poll.sh +++ b/dev2/deploy-poll.sh @@ -16,6 +16,9 @@ # deploy-poll.sh --dry-run print what it would deploy # deploy-poll.sh --status one line per polled site # +# A site whose workflow did more after the deploy keeps that in an executable +# ~/www//post-deploy.sh, run once deploy-app.sh succeeds. +# # A sha whose deploy failed is not retried until a newer commit lands, so a # broken main costs one build, not one every two minutes. Logs: # ~/.local/state/deploy-poll/.log; the run log is poll.log beside them. @@ -106,7 +109,10 @@ for env in "$WWW"/*/deploy.env; do flock -n 8 || exit 0 { echo "===== $(date -u +%FT%TZ) deploy $tip" - if "$WWW/$site/deploy-app.sh" "$tip"; then + # post-deploy.sh beside deploy-app.sh holds what a workflow did after the + # deploy step (weedforcrypto restarts its host-side worker there). + if "$WWW/$site/deploy-app.sh" "$tip" && + { [ ! -x "$WWW/$site/post-deploy.sh" ] || "$WWW/$site/post-deploy.sh"; }; then rm -f "$STATE_DIR/$site.failed" echo "===== ok" log "$site: ${tip:0:8} deployed"