label container in cli test

This commit is contained in:
Frederik Ring 2021-07-11 20:21:17 +02:00
parent da75d232f4
commit 5fd6f66324
5 changed files with 8 additions and 5 deletions

View File

@ -15,7 +15,7 @@ jobs:
name: Run tests name: Run tests
working_directory: ~/docker-volume-backup/test working_directory: ~/docker-volume-backup/test
command: | command: |
./test.sh ./test.sh canary
build: build:
docker: docker:

View File

@ -23,6 +23,7 @@ docker exec minio mkdir -p /data/backup
docker run -d \ docker run -d \
--name offen \ --name offen \
--network test_network \ --network test_network \
--label "docker-volume-backup.stop-during-backup=true" \
-v app_data:/var/opt/offen/ \ -v app_data:/var/opt/offen/ \
offen/offen:latest offen/offen:latest
@ -40,7 +41,7 @@ docker run -d \
--env AWS_S3_BUCKET_NAME=backup \ --env AWS_S3_BUCKET_NAME=backup \
--env BACKUP_FILENAME=test.tar.gz \ --env BACKUP_FILENAME=test.tar.gz \
--env BACKUP_CRON_EXPRESSION="0 0 5 31 2 ?" \ --env BACKUP_CRON_EXPRESSION="0 0 5 31 2 ?" \
offen/docker-volume-backup:canary offen/docker-volume-backup:$TEST_VERSION
docker exec backup backup docker exec backup backup

View File

@ -13,7 +13,7 @@ services:
- backup_data:/data - backup_data:/data
backup: &default_backup_service backup: &default_backup_service
image: offen/docker-volume-backup:canary image: offen/docker-volume-backup:${TEST_VERSION}
depends_on: depends_on:
- minio - minio
restart: always restart: always

View File

@ -19,7 +19,7 @@ services:
- backup_data:/data - backup_data:/data
backup: &default_backup_service backup: &default_backup_service
image: offen/docker-volume-backup:canary image: offen/docker-volume-backup:${TEST_VERSION}
depends_on: depends_on:
- minio - minio
deploy: deploy:

View File

@ -2,13 +2,15 @@
set -e set -e
TEST_VERSION=${1:-canary}
for dir in $(ls -d -- */); do for dir in $(ls -d -- */); do
test="${dir}run.sh" test="${dir}run.sh"
echo "################################################" echo "################################################"
echo "Now running $test" echo "Now running $test"
echo "################################################" echo "################################################"
echo "" echo ""
/bin/sh $test TEST_VERSION=$TEST_VERSION /bin/sh $test
echo "" echo ""
echo "$test passed" echo "$test passed"
echo "" echo ""