fix Remove duplicate production tests

Keep full verification in the pre-push hook. Use the deployment host for the release build and health check.

Commit
a4b9e9f6bd0e66f5a3f60bd96beab68aef035bdb
Author
Marius Peter <dev@marius-peter.com>
Author date
Committer
Marius Peter <dev@marius-peter.com>
Committer date
Changed files
.kiro/steering/workflow.md
index 1b582dc4..ad52a6bc 100644..100644
@@ -30,8 +30,9 @@
30 30 `scripts/install-hooks.sh` enables the hook once for each clone.
31 31
32 32 On the deployment host, `deploy/post-receive` builds each push to `master`
33 Removed: again. It installs the dependencies, then runs `dune build @check`,
34 Removed: `dune runtest`, and a release build. It does not run the formatting check.
33 Added: again. It installs runtime dependencies and builds the application. The hook
34 Added: then checks that the service answers HTTP. It does not repeat the development
35 Added: verification gate.
35 36
36 37 Apply these rules:
37 38
README.org
index b452d33a..73847d88 100644..100644
@@ -73,8 +73,9 @@
73 73 * Deploy
74 74
75 75 ~deploy/setup.sh~ prepares the deployment host. ~deploy/post-receive~ builds
76 Removed: and tests each push to ~master~, then replaces the live release. If the health
77 Removed: check fails, the hook goes back to the previous release.
76 Added: each push to ~master~, then replaces the live release. The pre-push hook runs
77 Added: the full verification gate before a push. If the health check fails, the hook
78 Added: goes back to the previous release.
78 79
79 80 * Doctrine
80 81
deploy/post-receive
index 920f562d..47195aee 100755..100755
@@ -7,10 +7,10 @@
7 7 # privileged action is restarting the service, through one scoped sudoers rule.
8 8 #
9 9 # For a push to master: check out the pushed revision into a fresh timestamped
10 Removed: # release, build and test it against the shared opam switch, flip
11 Removed: # /srv/hito/current, restart the service, and confirm it answers HTTP. Any
12 Removed: # build or test failure leaves the live release untouched. A failed health
13 Removed: # check rolls current back to the previous release and restarts.
10 Added: # release, build it against the shared opam switch, flip /srv/hito/current,
11 Added: # restart the service, and confirm it answers HTTP. Any build failure leaves
12 Added: # the live release untouched. A failed health check rolls current back to the
13 Added: # previous release and restarts.
14 14 #
15 15 # Style: Google Shell Style Guide.
16 16
@@ -58,8 +58,9 @@
58 58 git --git-dir="${BARE}" archive "${sha}" | tar -x -C "${rel}"
59 59 }
60 60
61 Removed: # Build and test against the shared switch. The full log stays inside the
62 Removed: # release so a successful deploy leaves a record, not only a failed one.
61 Added: # Build the release artifact against the shared switch. The full log stays
62 Added: # inside the release so a successful deploy leaves a record, not only a failed
63 Added: # one.
63 64 build_release() {
64 65 local rel="$1"
65 66 local buildlog="${rel}/deploy.log"
@@ -67,16 +68,8 @@
67 68 cd "${rel}"
68 69
69 70 err "syncing dependencies"
70 Removed: opam install . --deps-only --with-test -y >"${buildlog}" 2>&1 \
71 Added: opam install . --deps-only -y >"${buildlog}" 2>&1 \
71 72 || { tail -30 "${buildlog}" >&2; return 1; }
72 Removed:
73 Removed: err "dune build @check"
74 Removed: dune build @check >>"${buildlog}" 2>&1 \
75 Removed: || { tail -40 "${buildlog}" >&2; return 1; }
76 Removed:
77 Removed: err "dune runtest"
78 Removed: dune runtest >>"${buildlog}" 2>&1 \
79 Removed: || { tail -40 "${buildlog}" >&2; return 1; }
80 73
81 74 err "dune build (release)"
82 75 dune build >>"${buildlog}" 2>&1 \