mirror of
https://github.com/chatmail/relay.git
synced 2026-05-19 12:28:06 +00:00
docker/ci: correct acme path and catch unhealthy status
This commit is contained in:
13
.github/workflows/docker-ci.yaml
vendored
13
.github/workflows/docker-ci.yaml
vendored
@@ -186,8 +186,8 @@ jobs:
|
|||||||
rsync -e "ssh -o StrictHostKeyChecking=accept-new" -avz root@ns.testrun.org:/tmp/${ACME_DIR} acme-restore || true
|
rsync -e "ssh -o StrictHostKeyChecking=accept-new" -avz root@ns.testrun.org:/tmp/${ACME_DIR} acme-restore || true
|
||||||
rsync -avz root@ns.testrun.org:/tmp/${DKIM_DIR} dkimkeys-restore || true
|
rsync -avz root@ns.testrun.org:/tmp/${DKIM_DIR} dkimkeys-restore || true
|
||||||
# restore to acme & dkim state
|
# restore to acme & dkim state
|
||||||
rsync -avz acme-restore/${ACME_DIR}/ root@${HOST}:/var/lib/acme/ || true
|
rsync -avz acme-restore/${ACME_DIR}/acme/ root@${HOST}:/var/lib/acme/ || true
|
||||||
rsync -avz dkimkeys-restore/${DKIM_DIR}/ root@${HOST}:/etc/dkimkeys/ || true
|
rsync -avz dkimkeys-restore/${DKIM_DIR}/dkimkeys/ root@${HOST}:/etc/dkimkeys/ || true
|
||||||
# copy acme & dkim state to docker bind mounts
|
# copy acme & dkim state to docker bind mounts
|
||||||
ssh root@${HOST} 'mkdir -p /srv/chatmail/certs /srv/chatmail/dkim && cp -a /var/lib/acme/. /srv/chatmail/certs/ && cp -a /etc/dkimkeys/. /srv/chatmail/dkim/'
|
ssh root@${HOST} 'mkdir -p /srv/chatmail/certs /srv/chatmail/dkim && cp -a /var/lib/acme/. /srv/chatmail/certs/ && cp -a /etc/dkimkeys/. /srv/chatmail/dkim/'
|
||||||
|
|
||||||
@@ -228,8 +228,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
HOST: ${{ matrix.host }}
|
HOST: ${{ matrix.host }}
|
||||||
run: |
|
run: |
|
||||||
# Stream journald inside the container so we see chatmail-init output in real time
|
# Stream journald inside the container
|
||||||
# (docker logs doesn't work with logging driver: none)
|
|
||||||
ssh root@${HOST} 'docker exec chatmail journalctl -f --no-pager' &
|
ssh root@${HOST} 'docker exec chatmail journalctl -f --no-pager' &
|
||||||
LOG_PID=$!
|
LOG_PID=$!
|
||||||
trap "kill $LOG_PID 2>/dev/null || true" EXIT
|
trap "kill $LOG_PID 2>/dev/null || true" EXIT
|
||||||
@@ -240,9 +239,13 @@ jobs:
|
|||||||
echo "Container is healthy."
|
echo "Container is healthy."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
if [ "$status" = "unhealthy" ]; then
|
||||||
|
echo "Container is unhealthy!"
|
||||||
|
break
|
||||||
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
echo "Container did not become healthy in time."
|
echo "Container did not become healthy."
|
||||||
kill $LOG_PID 2>/dev/null || true
|
kill $LOG_PID 2>/dev/null || true
|
||||||
echo "--- failed units ---"
|
echo "--- failed units ---"
|
||||||
ssh root@${HOST} 'docker exec chatmail systemctl --failed --no-pager' || true
|
ssh root@${HOST} 'docker exec chatmail systemctl --failed --no-pager' || true
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ COPY --chmod=555 ./docker/chatmail-init.sh /chatmail-init.sh
|
|||||||
COPY --chmod=555 ./docker/entrypoint.sh /entrypoint.sh
|
COPY --chmod=555 ./docker/entrypoint.sh /entrypoint.sh
|
||||||
COPY --chmod=555 ./docker/healthcheck.sh /healthcheck.sh
|
COPY --chmod=555 ./docker/healthcheck.sh /healthcheck.sh
|
||||||
|
|
||||||
HEALTHCHECK --interval=15s --timeout=10s --retries=3 \
|
HEALTHCHECK --interval=10s --start-period=180s --timeout=10s --retries=3 \
|
||||||
CMD /healthcheck.sh
|
CMD /healthcheck.sh
|
||||||
|
|
||||||
STOPSIGNAL SIGRTMIN+3
|
STOPSIGNAL SIGRTMIN+3
|
||||||
|
|||||||
Reference in New Issue
Block a user