mirror of
https://github.com/ViViDboarder/docker-restic-cron.git
synced 2024-11-21 20:56:36 +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
|
Makefile
|
||||||
Readme.md
|
Readme.md
|
||||||
docker-compose.yaml
|
docker-compose.yaml
|
||||||
|
docker-compose-test-s3.yml
|
||||||
test.sh
|
test.sh
|
||||||
|
itest.sh
|
||||||
|
test-s3.sh
|
||||||
|
@ -3,4 +3,5 @@ services: docker
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
- make build-all
|
- 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
|
.PHONY: test-x86
|
||||||
test-x86: build-x86
|
test-x86: build-x86
|
||||||
./test.sh $(DOCKER_TAG) ubuntu
|
./test.sh $(DOCKER_TAG):ubuntu
|
||||||
|
|
||||||
.PHONY: test-arm
|
.PHONY: test-arm
|
||||||
test-arm: build-arm
|
test-arm: build-arm
|
||||||
./test.sh $(DOCKER_TAG) raspbian
|
./test.sh $(DOCKER_TAG):raspbian
|
||||||
|
|
||||||
.PHONY: test-all
|
.PHONY: test-all
|
||||||
test-all: test-x86 test-arm
|
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
|
.PHONY: shell-x86
|
||||||
shell-x86: build-x86
|
shell-x86: build-x86
|
||||||
docker run --rm -it $(DOCKER_TAG):ubuntu bash
|
docker run --rm -it $(DOCKER_TAG):ubuntu bash
|
||||||
@ -38,3 +49,7 @@ shell-arm: build-arm
|
|||||||
|
|
||||||
.PHONY: shell
|
.PHONY: shell
|
||||||
shell: shell-x86
|
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'
|
version: '2'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
duplicity:
|
duplicity:
|
||||||
build: .
|
build: .
|
||||||
volumes:
|
volumes:
|
||||||
- ~/.gnupg:/root/.gnupg:ro
|
|
||||||
- ~/my-backups:/backups
|
- ~/my-backups:/backups
|
||||||
- ~/my-data:/data:ro
|
- ~/my-data:/data:ro
|
||||||
environment:
|
environment:
|
||||||
GPG_KEY_ID: 2CBD492E
|
|
||||||
PASSPHRASE: Correct.Horse.Battery.Staple
|
PASSPHRASE: Correct.Horse.Battery.Staple
|
||||||
CLEANUP_COMMAND: remove-older-than 5m
|
CLEANUP_COMMAND: remove-older-than 5m
|
||||||
CRON_SCHEDULE: "* * * * *"
|
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
|
#! /bin/bash
|
||||||
|
|
||||||
image_name=$1
|
image=$1
|
||||||
tag=$2
|
|
||||||
|
|
||||||
full_image="${image_name}:${tag}"
|
|
||||||
container_name="${image_name}-${tag}"
|
|
||||||
|
|
||||||
# Run the test script within the container
|
# Run the test script within the container
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-e SKIP_ON_START=true \
|
-e SKIP_ON_START=true \
|
||||||
-v "$(pwd)/itest.sh:/itest.sh" \
|
-v "$(pwd)/itest.sh:/itest.sh" \
|
||||||
--name ${container_name} \
|
$image \
|
||||||
$full_image \
|
|
||||||
bash -c "/itest.sh"
|
bash -c "/itest.sh"
|
||||||
|
Loading…
Reference in New Issue
Block a user