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
5 changes: 4 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
else
TAG=${GITHUB_REF#refs/heads/}
fi
# A branch like feature/x is not a valid image tag; use feature-x.
TAG=${TAG//\//-}
echo "tag=$TAG" >> $GITHUB_OUTPUT

- name: Test NGINX configuration
Expand Down Expand Up @@ -83,7 +85,8 @@ jobs:
fi
docker logs test-container | grep -q 'Scheduled cache backup: crontab' || { echo "backup not scheduled"; docker logs test-container; exit 1; }
docker exec test-container test -f /var/cache/nginx/owlery/0/00/00000000000000000000000000000001 || { echo "archive entry not restored"; docker logs test-container; exit 1; }
docker exec test-container wget -q -O - http://localhost/status | grep -q '"restore": {' || { echo "/status lacks archive.restore"; docker exec test-container wget -q -O - http://localhost/status; exit 1; }
# 127.0.0.1, not localhost: BusyBox wget resolves localhost to ::1 first and nginx listens on IPv4 only.
docker exec test-container wget -q -O - http://127.0.0.1/status | grep -q '"restore": {' && docker exec test-container wget -q -O - http://127.0.0.1/status | grep -q '"state": "done"' || { echo "/status lacks archive.restore"; docker exec test-container wget -q -O - http://127.0.0.1/status; exit 1; }
docker exec test-container cache-backup.sh --full | grep -q 'backup: done' || { echo "manual backup failed"; exit 1; }
docker stop test-container || true
docker rm test-container
Expand Down
3 changes: 2 additions & 1 deletion health-monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ CACHE_BACKUP_STATE=${CACHE_BACKUP_STATE:-$STATUS_DIR/cache-backup.json}
# when that job has not run in this container yet.
json_state_or_null() {
if [ -s "$1" ]; then
sed 's/^/ /' "$1"
# Indent every line but the first, which follows the key on its own line.
sed '1!s/^/ /' "$1"
else
printf 'null'
fi
Expand Down
Loading