mirror of
https://github.com/ViViDboarder/docker-duplicity-cron.git
synced 2024-11-21 11:56:29 +00:00
Add new integration test against minio
Should simulate an S3 test
This commit is contained in:
parent
1fdaff84e4
commit
9e9f9ec956
@ -2,4 +2,7 @@ Dockerfile.*
|
||||
Makefile
|
||||
Readme.md
|
||||
docker-compose.yaml
|
||||
docker-compose-test-s3.yml
|
||||
test.sh
|
||||
itest.sh
|
||||
test-s3.sh
|
||||
|
@ -3,4 +3,5 @@ services: docker
|
||||
|
||||
script:
|
||||
- make build-all
|
||||
- make test
|
||||
- make test-x86
|
||||
- make test-s3-x86
|
||||
|
19
Makefile
19
Makefile
@ -19,15 +19,26 @@ build-all: build-x86 build-arm
|
||||
|
||||
.PHONY: test-x86
|
||||
test-x86: build-x86
|
||||
./test.sh $(DOCKER_TAG) ubuntu
|
||||
./test.sh $(DOCKER_TAG):ubuntu
|
||||
|
||||
.PHONY: test-arm
|
||||
test-arm: build-arm
|
||||
./test.sh $(DOCKER_TAG) raspbian
|
||||
./test.sh $(DOCKER_TAG):raspbian
|
||||
|
||||
.PHONY: test-all
|
||||
test-all: test-x86 test-arm
|
||||
|
||||
.PHONY: test-s3-x86
|
||||
test-s3-x86:
|
||||
./test-s3.sh ubuntu
|
||||
|
||||
.PHONY: test-s3-arm
|
||||
test-s3-arm:
|
||||
./test-s3.sh raspbian
|
||||
|
||||
.PHONY: test-s3-all
|
||||
test-s3-all: test-s3-x86 test-s3-arm
|
||||
|
||||
.PHONY: shell-x86
|
||||
shell-x86: build-x86
|
||||
docker run --rm -it $(DOCKER_TAG):ubuntu bash
|
||||
@ -38,3 +49,7 @@ shell-arm: build-arm
|
||||
|
||||
.PHONY: shell
|
||||
shell: shell-x86
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
docker-compose -f docker-compose-test-s3.yml down -v
|
||||
|
29
docker-compose-test-s3.yml
Normal file
29
docker-compose-test-s3.yml
Normal file
@ -0,0 +1,29 @@
|
||||
version: '2'
|
||||
services:
|
||||
duplicity:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.${DOCKER_BASE}
|
||||
entrypoint: "bash"
|
||||
command: ["/itest.sh"]
|
||||
hostname: itest
|
||||
environment:
|
||||
SKIP_ON_START: 'true'
|
||||
OPT_ARGUMENTS: '--s3-unencrypted-connection'
|
||||
BACKUP_DEST: s3://minio:9000/duplicity
|
||||
AWS_DEFAULT_REGION: us-east-1
|
||||
AWS_ACCESS_KEY_ID: SUPER_SECRET_ACCESS_KEY
|
||||
AWS_SECRET_ACCESS_KEY: SUPER_SECRET_SECRET_KEY
|
||||
volumes:
|
||||
- "./itest.sh:/itest.sh"
|
||||
links:
|
||||
- minio
|
||||
minio:
|
||||
image: minio/minio
|
||||
command: server /data
|
||||
hostname: minio
|
||||
expose:
|
||||
- "9000"
|
||||
environment:
|
||||
MINIO_ACCESS_KEY: SUPER_SECRET_ACCESS_KEY
|
||||
MINIO_SECRET_KEY: SUPER_SECRET_SECRET_KEY
|
@ -1,14 +1,11 @@
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
duplicity:
|
||||
build: .
|
||||
volumes:
|
||||
- ~/.gnupg:/root/.gnupg:ro
|
||||
- ~/my-backups:/backups
|
||||
- ~/my-data:/data:ro
|
||||
environment:
|
||||
GPG_KEY_ID: 2CBD492E
|
||||
PASSPHRASE: Correct.Horse.Battery.Staple
|
||||
CLEANUP_COMMAND: remove-older-than 5m
|
||||
CRON_SCHEDULE: "* * * * *"
|
||||
|
6
test-s3.sh
Executable file
6
test-s3.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#! /bin/bash
|
||||
|
||||
export DOCKER_BASE=$1
|
||||
|
||||
docker-compose -f docker-compose-test-s3.yml up \
|
||||
--build --abort-on-container-exit --force-recreate
|
9
test.sh
9
test.sh
@ -1,15 +1,10 @@
|
||||
#! /bin/bash
|
||||
|
||||
image_name=$1
|
||||
tag=$2
|
||||
|
||||
full_image="${image_name}:${tag}"
|
||||
container_name="${image_name}-${tag}"
|
||||
image=$1
|
||||
|
||||
# Run the test script within the container
|
||||
docker run --rm \
|
||||
-e SKIP_ON_START=true \
|
||||
-v "$(pwd)/itest.sh:/itest.sh" \
|
||||
--name ${container_name} \
|
||||
$full_image \
|
||||
$image \
|
||||
bash -c "/itest.sh"
|
||||
|
Loading…
Reference in New Issue
Block a user