Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dev2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ does what it did from the box: for every `~/www/<site>/deploy.env` whose `REPO`
private repo, `git ls-remote <REPO> HEAD` with the site's deploy key, and when that
is not `.deploy-state`'s `DEPLOYED_SHA`, `deploy-app.sh <sha>` 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/<site>/post-deploy.sh`
(weedforcrypto.com: restart its host-side worker).

```
deploy-poll.sh --status site, deployed, tip, current|behind|failed|unreachable
Expand Down
8 changes: 7 additions & 1 deletion dev2/deploy-poll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/<site>/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/<site>.log; the run log is poll.log beside them.
Expand Down Expand Up @@ -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"
Expand Down
Loading