File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848 - name : Connect Postgres service to network
4949 run : docker network connect ci_network postgres-db || echo "Postgres already connected"
5050
51-
51+ - name : Wait for Postgres to be ready
52+ run : |
53+ for i in {1..30}; do
54+ nc -z postgres-db 5432 && echo "Postgres is ready" && exit 0
55+ echo "Waiting for Postgres..."
56+ sleep 2
57+ done
58+ echo "Postgres did not become ready in time"
59+ exit 1
60+
5261 - name : Run backup script test
5362 run : |
5463 mkdir -p ./backups
6574 -v $(pwd)/backups:/mnt/backups \
6675 $IMAGE_NAME:$TAG /backup.sh
6776
77+ - name : Run backup script test without volume
78+ run : |
79+ docker run --rm \
80+ --network ci_network \
81+ -e DB_HOST=postgres-db \
82+ -e DB_PORT=5432 \
83+ -e DB_USER=myuser \
84+ -e DB_PASSWORD=mypass \
85+ -e DB_NAME=mydatabase \
86+ -e BACKUP_DIR=/mnt/backups \
87+ -e RETENTION_DAYS=7 \
88+ -e ENCRYPT=false \
89+ $IMAGE_NAME:$TAG /backup.sh
90+
6891 - name : Check backup created
6992 run : |
7093 ls -lh ./backups
You can’t perform that action at this time.
0 commit comments