CI: clean up leftover vu-smoke container before the smoke test
Deploy / deploy (push) Failing after 30s
Deploy / deploy (push) Failing after 30s
The shell runs with -e, so a failed curl/grep check on any past run would skip docker stop and leave vu-smoke bound to port 8080 — which is exactly what happened, blocking this run's own docker run with "port is already allocated". Remove any leftover container unconditionally before starting, rather than assuming the previous run's cleanup succeeded. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,12 +27,20 @@ jobs:
|
|||||||
# test would exercise beyond "does the built bundle actually get
|
# test would exercise beyond "does the built bundle actually get
|
||||||
# served correctly under the /vu/ base path" — this is that check,
|
# served correctly under the /vu/ base path" — this is that check,
|
||||||
# run against the exact image that ships.
|
# run against the exact image that ships.
|
||||||
|
#
|
||||||
|
# The shell runs with `-e`, so a failed curl/grep on a past run
|
||||||
|
# could skip `docker stop`/`rm` and leave vu-smoke bound to 8080,
|
||||||
|
# blocking every run after it — clean up any leftover first,
|
||||||
|
# unconditionally, rather than relying on the previous run's own
|
||||||
|
# cleanup having succeeded.
|
||||||
run: |
|
run: |
|
||||||
|
docker rm -f vu-smoke 2>/dev/null || true
|
||||||
docker build -t vu:ci .
|
docker build -t vu:ci .
|
||||||
docker run -d --name vu-smoke -p 8080:80 vu:ci
|
docker run -d --name vu-smoke -p 8080:80 vu:ci
|
||||||
sleep 1
|
sleep 1
|
||||||
curl -sf http://localhost:8080/ | grep -q 'vu — Divine Office'
|
curl -sf http://localhost:8080/ | grep -q 'vu — Divine Office'
|
||||||
docker stop vu-smoke
|
docker stop vu-smoke
|
||||||
|
docker rm vu-smoke
|
||||||
|
|
||||||
- name: Trigger redeploy via SSH
|
- name: Trigger redeploy via SSH
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user