Add new s3 tests and add more dependencies for backends

This commit is contained in:
ViViDboarder 2017-11-15 19:01:44 -08:00
parent f7cdf9c9b6
commit a13a522810
9 changed files with 84 additions and 19 deletions

View File

@ -2,4 +2,7 @@ Dockerfile.*
Makefile
Readme.md
docker-compose.yaml
docker-compose-test-s3.yml
test.sh
itest.sh
test-s3.sh

View File

@ -3,4 +3,5 @@ services: docker
script:
- make build-all
- make test
- make test-x86
- make test-s3-x86

View File

@ -4,8 +4,21 @@ MAINTAINER ViViDboarder <vividboarder@gmail.com>
RUN [ "cross-build-start" ]
RUN apt-get update \
&& apt-get install -y --no-install-recommends duplicity python-setuptools \
ncftp cron python-boto python-swiftclient python-pexpect openssh-client \
&& apt-get install -y --no-install-recommends \
duplicity python-setuptools cron python-pexpect openssh-client \
lftp \
ncftp \
python-cloudfiles \
python-gdata \
python-oauthlib \
python-paramiko \
python-swiftclient \
python-urllib3 \
rsync \
tahoe-lafs \
python-pip \
&& pip install -U boto \
&& apt-get remove -y python-pip python-pip-whl \
&& rm -rf /var/apt/lists/*
RUN [ "cross-build-end" ]

View File

@ -7,10 +7,20 @@ RUN apt-get update \
&& add-apt-repository ppa:duplicity-team/ppa \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
duplicity python-setuptools ncftp \
python-swiftclient python-pip python-pexpect openssh-client \
&& pip install boto \
&& apt-get autoremove -y python-pip \
duplicity python-setuptools python-pexpect openssh-client \
lftp \
ncftp \
python-cloudfiles \
python-gdata \
python-oauthlib \
python-paramiko \
python-swiftclient \
python-urllib3 \
rsync \
tahoe-lafs \
python-pip \
&& pip install -U boto \
&& apt-get remove -y python-pip python-pip-whl \
&& apt-get clean \
&& rm -rf /var/apt/lists/*

View File

@ -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

View 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

View File

@ -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
View 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

View File

@ -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"