Skip to content

Commit 1552a1e

Browse files
committed
workflow test6
1 parent c3eb29d commit 1552a1e

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

.github/workflows/bica-ci.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,16 @@ jobs:
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
@@ -65,6 +74,20 @@ jobs:
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

0 commit comments

Comments
 (0)