gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit74ec2af874ec2af8Merge branch 'w54-repo-rename-pr' into mainGitoria74ec2af8/deploy.sh

18.3 KB

  1. #!/usr/bin/env bash
  2. # deploy.sh — gitoria.worldapi.org: Loreana (this folder) → Byrodin. Run ON LOREANA.
  3. #
  4. # ./deploy.sh gates → backup → rsync → restart the container → public URL 200
  5. # ./deploy.sh --dry-run gates → rsync -n (shows what WOULD be sent), no backup, no restart, no URL check
  6. # ./deploy.sh --skip-tests skips the gates (LOUD warning) — only when you know why
  7. # ./deploy.sh --target DIR|HOST:DIR another destination (default below); a local DIR is
  8. # how the script is tested without touching Byrodin
  9. # ./deploy.sh --url URL the URL that must answer 200 after the restart
  10. # (env: DEPLOY_TARGET, DEPLOY_URL, DEPLOY_SSH override the same defaults)
  11. # (backup: tars storage/.sessions/.env that exist on the target to Loreana's
  12. # /media/SLOW1TB2/deploy-backups/<app>/, keeps newest 5; --target DIR backs up DIR instead)
  13. #
  14. # THE FIRST DEPLOY is done by the architect on Byrodin (folder, data, nginx vhost, cert,
  15. # DNS). This script only updates the CODE: storage/, .sessions/, .env, .scratch/, server.*,
  16. # testapp/ and logs are never sent, so live data on Byrodin is never touched.
  17. # No --delete: a file removed here stays on Byrodin (harmless — nothing imports it).
  18. set -euo pipefail
  19. # ---- the app ------------------------------------------------------------------------------
  20. APP=gitoria.worldapi.org
  21. CONTAINER=gitoria.worldapi.org
  22. [email protected]:/CONTAINERS/projects/gitoria.worldapi.org
  23. DEFAULT_URL=https://gitoria.worldapi.org/
  24. GATES=(
  25. "GITORIA_RENAME_PORT=${GITORIA_RENAME_PORT:-8728} GITORIA_GATE_CHROME=${GITORIA_GATE_CHROME:-8731-8733} node tests/repo-rename.mjs"
  26. "GITORIA_PA_PORT=${GITORIA_PA_PORT:-8720} GITORIA_GATE_CHROME=${GITORIA_GATE_CHROME:-8725-8729} node tests/person-approval.mjs"
  27. "GITORIA_CREATE_PORT=${GITORIA_CREATE_PORT:-8720} GITORIA_CREATE_IDENT_PORT=${GITORIA_CREATE_IDENT_PORT:-8721} GITORIA_GATE_CHROME=${GITORIA_GATE_CHROME:-8725-8729} node tests/create-api.mjs" # gitoria#39: user-token repository creation
  28. "GITORIA_SIGNIN_PORT=${GITORIA_SIGNIN_PORT:-8720} GITORIA_SIGNIN_CHROME=${GITORIA_SIGNIN_CHROME:-8723-8729} node tests/signin-return.mjs" # ident#31: sign in through the selector panel, back on the same page
  29. "node theme/check-theme.mjs ."
  30. "GITORIA_GATE_PORT=${GITORIA_GATE_PORT:-8720} GITORIA_GATE_IDENT_PORT=${GITORIA_GATE_IDENT_PORT:-8721} GITORIA_GATE_TICKETS_PORT=${GITORIA_GATE_TICKETS_PORT:-8722} GITORIA_GATE_FIREFOX=${GITORIA_GATE_FIREFOX:-8730} GITORIA_GATE_CHROME=${GITORIA_GATE_CHROME:-8723-8729} node tests/browser.mjs"
  31. "GITORIA_SEC_PORT=${GITORIA_SEC_PORT:-8720} GITORIA_SEC_PORT2=${GITORIA_SEC_PORT2:-8721} GITORIA_SEC_IDENT_PORT=${GITORIA_SEC_IDENT_PORT:-8722} node tests/security.mjs"
  32. "GITORIA_PRIV_PORT=${GITORIA_PRIV_PORT:-8720} GITORIA_PRIV_IDENT_PORT=${GITORIA_PRIV_IDENT_PORT:-8721} node tests/private.mjs" # go34: private repos, organizations (158 checks)
  33. "GITORIA_IDA_PORT=${GITORIA_IDA_PORT:-8738} GITORIA_IDA_IDENT_PORT=${GITORIA_IDA_IDENT_PORT:-8739} node tests/ident-access-gitoria.mjs" # ident#27: an idt_ access key as the git password
  34. "GITORIA_APPS_PORT=${GITORIA_APPS_PORT:-8720} GITORIA_APPS_IDENT_PORT=${GITORIA_APPS_IDENT_PORT:-8721} node tests/apps.mjs" # gitoria#41: apps connected to a repo (URL allow-list, connect flow, add/remove/rotate)
  35. "GITORIA_PULLS_PORT=${GITORIA_PULLS_PORT:-8720} node tests/pull-numbers.mjs" # gitoria#40: PR numbers, refs/pull/N/head, the changes of syncPulls, wasHeadOf
  36. "GITORIA_PULLSSH_PORT=${GITORIA_PULLSSH_PORT:-8720} GITORIA_PULLSSH_SSH_PORT=${GITORIA_PULLSSH_SSH_PORT:-8721} node tests/pull-ssh.mjs" # gitoria#40: the same over the sshd door (docker)
  37. "GITORIA_TOKEN_PORT=${GITORIA_TOKEN_PORT:-8720} GITORIA_TOKEN_IDENT_PORT=${GITORIA_TOKEN_IDENT_PORT:-8721} node tests/app-token.mjs" # gitoria#42: an app trades its key for a one-hour token; git read with it, no push
  38. "GITORIA_REVIEWS_PORT=${GITORIA_REVIEWS_PORT:-8720} node tests/reviews.mjs" # gitoria#44: reviews with inline threads, replies, resolve, conversation (409/422/404, earlier head, paging, seq)
  39. "GITORIA_EVENTS_PORT=${GITORIA_EVENTS_PORT:-8720} node tests/events.mjs" # gitoria#43: signed events to apps (HMAC, retries, Merge button, ping, delivery log, two processes, retention)
  40. "GITORIA_PRPAGE_PORT=${GITORIA_PRPAGE_PORT:-8720} GITORIA_GATE_CHROME=${GITORIA_GATE_CHROME:-8725-8729} node tests/pr-page.mjs" # gitoria#45: the PR page (comments, threads, Review again, who hears of it, escaping, read-only for others)
  41. "GITORIA_STATUS_PORT=${GITORIA_STATUS_PORT:-8720} GITORIA_STATUS_IDENT_PORT=${GITORIA_STATUS_IDENT_PORT:-8721} node tests/status.mjs" # gitoria#46: statuses an app sets on a commit, required before merge, badges on /pulls
  42. "GITORIA_LIMITS_PORT=${GITORIA_LIMITS_PORT:-8720} GITORIA_LIMITS_IDENT_PORT=${GITORIA_LIMITS_IDENT_PORT:-8721} node tests/limits.mjs" # gitoria#47: status read route, pull.statuses/required, tickets list, 413/400, rate limits (429 + Retry-After)
  43. "GITORIA_KEYED_PORT=${GITORIA_KEYED_PORT:-8720} GITORIA_KEYED_IDENT_PORT=${GITORIA_KEYED_IDENT_PORT:-8721} node tests/status-keyed.mjs" # gitoria#46 v1.4: statuses keyed by app + context; an old-shape row (the old code on the same storage) is read and replaced
  44. "GITORIA_MM_PORT=${GITORIA_MM_PORT:-8720} GITORIA_GATE_CHROME=${GITORIA_GATE_CHROME:-8725-8729} node tests/member-merge.mjs" # gitoria#48: a member merges a PR with a gtr_ token once the required checks pass (API + button, apps never)
  45. "GITORIA_PM_PORT=${GITORIA_PM_PORT:-8720} node tests/protect-main.mjs" # gitoria#50: refuse direct pushes to the main branch (owner setting; https + ssh; branches, tags, merges stay)
  46. )
  47. # NEVER SENT (rsync patterns; a leading / anchors at the app folder)
  48. EXCLUDES=(
  49. /.git/ /.gitignore
  50. /storage/ /.sessions/ /.env /.env.* /.scratch/ /server.* /testapp/
  51. '*.log' '*.pid' node_modules/
  52. )
  53. # ---------------------------------------------------------------------------------------------
  54. DRY=0
  55. SKIP=0
  56. TARGET=${DEPLOY_TARGET:-$DEFAULT_TARGET}
  57. URL=${DEPLOY_URL:-$DEFAULT_URL}
  58. # how long the URL may take after the restart (seconds); a cold start compiles first (hybriel#148)
  59. URL_WAIT=${DEPLOY_URL_WAIT:-120}
  60. # Loreana's ssh config may not apply to Byrodin: -F /dev/null (ident STATUS)
  61. SSH=${DEPLOY_SSH:-ssh -F /dev/null -o BatchMode=yes -o ConnectTimeout=15}
  62. usage() { sed -n '2,15p' "$0" | sed 's/^# \{0,1\}//'; }
  63. while [ $# -gt 0 ]; do
  64. case "$1" in
  65. --dry-run) DRY=1 ;;
  66. --skip-tests) SKIP=1 ;;
  67. --target) TARGET=${2:?--target needs a value}; shift ;;
  68. --target=*) TARGET=${1#--target=} ;;
  69. --url) URL=${2:?--url needs a value}; shift ;;
  70. --url=*) URL=${1#--url=} ;;
  71. -h|--help) usage; exit 0 ;;
  72. *) echo "deploy: unknown argument: $1" >&2; usage >&2; exit 2 ;;
  73. esac
  74. shift
  75. done
  76. HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
  77. cd "$HERE"
  78. step() { printf '\n==> %s\n' "$*"; }
  79. run() { printf ' $ %s\n' "$*" >&2; "$@"; }
  80. die() { printf '\ndeploy: REFUSED — %s\n' "$*" >&2; exit 1; }
  81. # a target `host:dir` is remote, a plain path is local
  82. if [[ "$TARGET" == *:* ]]; then
  83. REMOTE_HOST=${TARGET%%:*}
  84. REMOTE_DIR=${TARGET#*:}
  85. else
  86. REMOTE_HOST=
  87. REMOTE_DIR=$TARGET
  88. fi
  89. step "[0/5] $APP → $TARGET (dry run: $DRY, skip tests: $SKIP)"
  90. echo " from $HERE"
  91. echo " url $URL"
  92. [ -x bin/hybriel ] || die "bin/hybriel is missing here"
  93. [ -f docker-compose.yml ] || die "docker-compose.yml is missing here"
  94. [ -f project.hl ] || die "project.hl is missing here"
  95. command -v rsync >/dev/null || die "rsync is not installed"
  96. # ---- 1. the gates ---------------------------------------------------------------------------
  97. if [ "$SKIP" = 1 ]; then
  98. step "[1/5] GATES SKIPPED"
  99. printf ' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n'
  100. printf ' !! --skip-tests: NOTHING WAS TESTED. You deploy untested code. !!\n'
  101. printf ' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n'
  102. else
  103. step "[1/5] gates (${#GATES[@]})"
  104. # headless Chromes that exist BEFORE the gates are not ours (other sessions' test runs, e.g. Anton's)
  105. chromes() { ps -eo pid=,ppid=,args= | awk '/[h]l-browser-tier/ && /remote-debugging-port/ && !/--type=/ {print $1, $2}'; }
  106. before=" $(chromes | awk '{print $1}' | tr '\n' ' ') "
  107. for g in "${GATES[@]}"; do
  108. printf ' $ %s\n' "$g"
  109. out=$(mktemp)
  110. if ! env $g > "$out" 2>&1; then
  111. grep -E '^FAIL|passed,' "$out" | sed 's/^/ /' || true
  112. echo " (full output: $out)"
  113. die "gate failed: $g"
  114. fi
  115. grep -E 'passed,|^check-theme:' "$out" | tail -1 | sed 's/^/ /' || true
  116. rm -f "$out"
  117. done
  118. # a Chrome our gates LEFT: new since the gates began AND no longer owned by a running node test
  119. # (a Chrome whose parent is a live node process belongs to another session's test run right now)
  120. leaked=""
  121. while read -r pid ppid; do
  122. [ -z "$pid" ] && continue
  123. case "$before" in *" $pid "*) continue ;; esac
  124. ps -o args= -p "$ppid" 2>/dev/null | grep -q '^node\|/node ' && continue
  125. leaked="$leaked $pid"
  126. done < <(chromes)
  127. if [ -n "$leaked" ]; then
  128. die "a gate left a headless Chrome (pids:$leaked; ps -eo pid,args | grep hl-browser-tier)"
  129. fi
  130. fi
  131. # ---- 2. pre-deploy backup of the LIVE data (before anything is sent) ------------------------
  132. BACKUP_ROOT=${DEPLOY_BACKUP_ROOT:-/media/SLOW1TB2/deploy-backups}
  133. BACKUP_DIR="$BACKUP_ROOT/$APP"
  134. BACKUP_FILE="$BACKUP_DIR/$APP-$(date +%Y%m%d-%H%M).tgz"
  135. if [ "$DRY" = 1 ]; then
  136. step "[2/5] DRY RUN: backup skipped"
  137. else
  138. step "[2/5] backup live data ($APP) → $BACKUP_FILE"
  139. mkdir -p "$BACKUP_DIR"
  140. if [ -n "$REMOTE_HOST" ]; then
  141. present=$($SSH "$REMOTE_HOST" "cd '$REMOTE_DIR' 2>/dev/null && for p in storage .sessions .env; do [ -e \"\$p\" ] && echo \"\$p\"; done; true")
  142. else
  143. present=$(cd "$REMOTE_DIR" 2>/dev/null && for p in storage .sessions .env; do [ -e "$p" ] && echo "$p"; done; true)
  144. fi
  145. present=$(printf '%s' "$present" | tr '\n' ' ' | sed 's/ *$//')
  146. if [ -z "$present" ]; then
  147. echo " nothing to back up yet (no storage/.sessions/.env on the target)"
  148. else
  149. echo " taring: $present"
  150. if [ -n "$REMOTE_HOST" ]; then
  151. # Order (Anton #203): directories, then every file except *.mpack (indexes, idxstate, sessions, .env), then the *.mpack
  152. # data last — a hot copy then never holds index offsets past the data it copied. tar exit 1 = "file changed as we
  153. # read it" / a file gone between find and tar (--ignore-failed-read) — a warning; the archive is checked with gzip -t.
  154. run $SSH "$REMOTE_HOST" "cd '$REMOTE_DIR' && { find $present -type d; find $present -type f ! -name '*.mpack' | LC_ALL=C sort; find $present -type f -name '*.mpack' | LC_ALL=C sort; } | tar czf - --hard-dereference --warning=no-file-changed --ignore-failed-read --no-recursion -T -; r=\$?; [ \$r -le 1 ]" > "$BACKUP_FILE" \
  155. || { rm -f "$BACKUP_FILE"; die "backup failed (tar/ssh error) — refusing to deploy"; }
  156. else
  157. run tar czf "$BACKUP_FILE" --hard-dereference -C "$REMOTE_DIR" $present \
  158. || { rm -f "$BACKUP_FILE"; die "backup failed (tar error) — refusing to deploy"; }
  159. fi
  160. [ -s "$BACKUP_FILE" ] || { rm -f "$BACKUP_FILE"; die "backup is empty — refusing to deploy"; }
  161. echo " $(du -h "$BACKUP_FILE" | cut -f1) $BACKUP_FILE"
  162. ls -1t "$BACKUP_DIR/$APP"-*.tgz 2>/dev/null | tail -n +6 | xargs -r rm -f --
  163. echo " keeping $(ls -1 "$BACKUP_DIR/$APP"-*.tgz 2>/dev/null | wc -l) archive(s) of $APP"
  164. fi
  165. fi
  166. # ---- 3. rsync the code ----------------------------------------------------------------------
  167. RSYNC=(rsync -az --no-owner --no-group --itemize-changes)
  168. for e in "${EXCLUDES[@]}"; do RSYNC+=("--exclude=$e"); done
  169. if [ -n "$REMOTE_HOST" ]; then
  170. RSYNC+=(-e "$SSH")
  171. else
  172. mkdir -p "$REMOTE_DIR"
  173. fi
  174. # the preview is ALWAYS made first (rsync -n): nothing that must stay on Byrodin may be in it
  175. step "[3/5] rsync preview (what would be sent)"
  176. preview=$(mktemp)
  177. run "${RSYNC[@]}" -n ./ "$TARGET/" > "$preview"
  178. sed 's/^/ /' "$preview"
  179. echo " ($(grep -c . "$preview" || true) lines)"
  180. if awk '{print $2}' "$preview" | grep -E '^(storage/|\.sessions/|\.env|\.scratch/|server\.|testapp/)|\.log$|\.pid$' ; then
  181. die "the preview holds a path that must never be sent (see above)"
  182. fi
  183. rm -f "$preview"
  184. if [ "$DRY" = 1 ]; then
  185. step "[3/5] DRY RUN: nothing sent"
  186. else
  187. step "[3/5] rsync"
  188. run "${RSYNC[@]}" ./ "$TARGET/" | sed 's/^/ /'
  189. fi
  190. # ---- 4. restart the container, without a gap ------------------------------------------------
  191. # Apollo 2026-10-25: the main container is never restarted before the standby (port 45014, compose profile "standby") answers 200.
  192. # The shared helper (worldapi-conductor/standby-swap.sh) is piped to Byrodin: it starts the standby with the new code, waits for 200 on
  193. # /api/repos, restarts the main container, waits for 200 on 45004 and stops the standby. nginx serves from the standby meanwhile. If the
  194. # standby never comes up, nothing live was touched and the deploy stops here.
  195. # Apollo 2026-11-02 mpackdb freeze: DEPLOY_STOP_START=1 replaces ONLY this step with stop-then-start. Two gitoria processes must never
  196. # have the same mpackdb files open at once (the standby swap runs the old and the new process side by side); so the standby is made sure
  197. # to be down, the main container is stopped, and it is started again only after the old process is really gone (container not running AND
  198. # its old pid no longer exists). Without the variable the standby swap below stays the default (deploy-init.sh relies on the string
  199. # standby-swap.sh in this file to skip a second restart).
  200. SWAP=${DEPLOY_STANDBY_SWAP:-/media/STORAGE/projects/WorldAPI/worldapi-conductor/standby-swap.sh}
  201. SWAP_ARGS="gitoria gitoria gitoria-standby /api/repos 45004"
  202. STOP_WAIT=${DEPLOY_STOP_WAIT:-60}
  203. # runs on the target (as one script, so a failure before the start leaves the container stopped and the deploy fails): $1 = app dir
  204. stop_start_script() {
  205. cat <<'EOS'
  206. set -u
  207. cd "$APP_DIR" || exit 1
  208. echo " standby: making sure gitoria-standby is not running"
  209. docker compose --profile standby stop gitoria-standby || true
  210. cid=$(docker compose ps -a -q gitoria)
  211. oldpid=0
  212. if [ -n "$cid" ]; then oldpid=$(docker inspect -f '{{.State.Pid}}' "$cid" 2>/dev/null || echo 0); fi
  213. echo " old container ${cid:-none} pid $oldpid"
  214. echo " docker compose stop gitoria"
  215. docker compose stop gitoria || { echo " stop failed - NOT starting" >&2; exit 1; }
  216. i=0
  217. while :; do
  218. st=$(docker inspect -f '{{.State.Running}} {{.State.Pid}}' "$cid" 2>/dev/null) || st="gone 0"
  219. running=${st%% *}; pid=${st##* }
  220. alive=no
  221. # the pid docker shows now (0 once stopped) and the pid it had before the stop: neither may still exist
  222. for q in "$pid" "$oldpid"; do
  223. if [ -n "$q" ] && [ "$q" != 0 ] && [ -d "/proc/$q" ]; then alive=yes; fi
  224. done
  225. echo " wait ${i}s: running=$running pid=$pid oldpid=$oldpid still-there=$alive"
  226. if [ "$running" != true ] && [ "$alive" = no ]; then break; fi
  227. i=$((i + 1))
  228. if [ "$i" -gt "$STOP_WAIT" ]; then echo " the old gitoria process is still there after ${STOP_WAIT}s - NOT starting" >&2; exit 1; fi
  229. sleep 1
  230. done
  231. echo " old process gone: docker compose up -d gitoria"
  232. docker compose up -d gitoria
  233. EOS
  234. }
  235. [ -f "$SWAP" ] || die "the hand-over helper is missing: $SWAP"
  236. if [ "${DEPLOY_STOP_START:-}" = 1 ]; then
  237. if [ "$DRY" = 1 ]; then
  238. step "[4/5] DRY RUN: would stop $CONTAINER, wait until its old process is gone, then start it (DEPLOY_STOP_START=1, mpackdb freeze: no standby swap)"
  239. echo " would run on $TARGET: docker compose --profile standby stop gitoria-standby; docker compose stop gitoria; wait up to ${STOP_WAIT}s until docker inspect -f '{{.State.Running}} {{.State.Pid}}' shows not running AND the pid is gone (otherwise fail, do NOT start); docker compose up -d gitoria"
  240. else
  241. step "[4/5] stop $CONTAINER, wait until its old process is gone, start it (DEPLOY_STOP_START=1, mpackdb freeze: no standby swap)"
  242. if [ -n "$REMOTE_HOST" ]; then
  243. printf ' $ %s %s "APP_DIR=%s STOP_WAIT=%s bash -s" (stop-then-start script)\n' "$SSH" "$REMOTE_HOST" "$REMOTE_DIR" "$STOP_WAIT" >&2
  244. stop_start_script | $SSH "$REMOTE_HOST" "APP_DIR='$REMOTE_DIR' STOP_WAIT='$STOP_WAIT' bash -s" || die "stop-then-start failed - the container may be stopped, look: $SSH $REMOTE_HOST docker ps -a"
  245. else
  246. stop_start_script | APP_DIR="$REMOTE_DIR" STOP_WAIT="$STOP_WAIT" bash -s || die "stop-then-start failed - the container may be stopped"
  247. fi
  248. fi
  249. elif [ "$DRY" = 1 ]; then
  250. step "[4/5] DRY RUN: would hand over $CONTAINER through its standby (no gap)"
  251. echo " would run: $SWAP_ARGS with $SWAP on $TARGET"
  252. DRY_RUN=1 APP_DIR="$REMOTE_DIR" bash "$SWAP" $SWAP_ARGS 2>&1 | sed 's/^/ /' || true
  253. else
  254. step "[4/5] hand over $CONTAINER through its standby (no gap)"
  255. if [ -n "$REMOTE_HOST" ]; then
  256. printf ' $ %s %s "APP_DIR=%s bash -s -- %s" < %s\n' "$SSH" "$REMOTE_HOST" "$REMOTE_DIR" "$SWAP_ARGS" "$SWAP" >&2
  257. $SSH "$REMOTE_HOST" "APP_DIR='$REMOTE_DIR' bash -s -- $SWAP_ARGS" < "$SWAP" || die "the hand-over failed — see the log above (the standby keeps serving if the main container did not come back)"
  258. else
  259. APP_DIR="$REMOTE_DIR" bash "$SWAP" $SWAP_ARGS || die "the hand-over failed — see the log above"
  260. fi
  261. fi
  262. # the helper only restarts the app container: bring the other service (the git-over-SSH sshd) up to date too, without restarting it when nothing changed
  263. if [ "$DRY" != 1 ]; then
  264. # the sshd image COPIES gitoria-shell / gitoria-keys / sshd_config: rebuild it first (cached when nothing changed), then `up -d` recreates the container only if its image changed (GO34c)
  265. CHANGED="cd '$REMOTE_DIR' && docker compose build gitoria-sshd && docker compose up -d"
  266. if [ -n "$REMOTE_HOST" ]; then run $SSH "$REMOTE_HOST" "$CHANGED"; else run bash -c "$CHANGED"; fi
  267. fi
  268. # ---- 5. the URL answers 200 -----------------------------------------------------------------
  269. if [ "$DRY" = 1 ]; then
  270. step "[5/5] DRY RUN: would check $URL answers 200"
  271. step "dry run done — nothing was sent, nothing restarted"
  272. exit 0
  273. fi
  274. step "[5/5] $URL must answer 200 (up to ${URL_WAIT}s: a new Hybriel compiles the app at its first start, ~20 s, hybriel#148)"
  275. code=000
  276. start=$SECONDS
  277. i=0
  278. while :; do
  279. i=$((i + 1))
  280. code=$(curl -s -o /dev/null -w '%{http_code}' --max-time 10 "$URL" || true)
  281. echo " try $i ($((SECONDS - start)) s): $code"
  282. [ "$code" = 200 ] && break
  283. [ $((SECONDS - start)) -ge "$URL_WAIT" ] && break
  284. sleep 2
  285. done
  286. if [ "$code" != 200 ]; then
  287. if [ -n "$REMOTE_HOST" ]; then die "$URL answered $code, not 200 — look: $SSH $REMOTE_HOST docker logs --tail 50 $CONTAINER"; fi
  288. die "$URL answered $code, not 200 — look: docker logs --tail 50 $CONTAINER"
  289. fi
  290. step "deployed $APP → $TARGET, $URL answers 200"

Branches

Latest commits

  • 74ec2af8Merge branch 'w54-repo-rename-pr' into mainGitoria
  • 9f7ce8d8Preserve rename compatibility and live page titlesmre
  • c3d95b6e|||PR separate names and addresses, rename repositories in Settings (#53)mre
  • ce08920dMerge branch 'w52c-header-phone' into mainGitoria
  • 0bab9e46|||PR header: ident status wraps on phones instead of clippingmre
  • e7af3eceMerge branch 'w52b-approval-followup' into mainGitoria
  • c01e66c6|||PR approvals follow-up: live Merge after status writes, helpers (#52)mre
  • 841da497Merge branch 'w53-pulls-speed-pr' into mainGitoria
  • 80307ae2|||PR pulls page cache: live PR numbers, complete scans onlymre
  • 69141f65|||PR pulls page: cache the git part per repo by branch tipsmre
  • 155861f6Merge branch 'w52-person-approval' into mainGitoria
  • b5435de8|||PR person approvals: second Kunibert round (#52)mre
  • 3a8b2fb8|||PR person approvals: Kunibert review fixes (#52)mre
  • 2a89d8d0|||PR person approvals: Approve button for people; merge needs the required checks or a listed person's approval (#52)mre
  • 83f0c953Report person approval verificationmre
  • 3ae94b86Record browser failures and verify owned tab cleanupmre
  • 54eec687Gate person approvals and merge alternativesmre
  • 12b08829Add person approvals for pull request headsmre
  • 55c84779Merge branch 'gp-gate-ports' into mainGitoria
  • 57af42bbREADME: point to deploy.sh for the port listmre