From f4275c5aef2e7d10399b6bf28a39a467890a454b Mon Sep 17 00:00:00 2001 From: Cobrijani Date: Sun, 7 Jul 2019 12:44:55 +0100 Subject: [PATCH] added changes from master --- Dockerfile | 2 +- config.yml | 21 +++++++++++++++++++++ docker-compose.test.yml | 9 +++++++++ entry.sh | 2 +- 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 config.yml create mode 100644 docker-compose.test.yml diff --git a/Dockerfile b/Dockerfile index e3c3742..f64f3ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,4 +33,4 @@ RUN touch /var/log/cron.log WORKDIR "/" ENTRYPOINT ["/entry.sh"] - +CMD ["tail","-fn0","/var/log/cron.log"] \ No newline at end of file diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..12228f0 --- /dev/null +++ b/config.yml @@ -0,0 +1,21 @@ +schemaVersion: '2.0.0' +commandTests: + - name: "restic package installation" + setup: [["/entry.sh"]] + command: "which" + args: ["restic"] + expectedOutput: ["/bin/restic"] +fileExistenceTests: +- name: 'log directory exists' + path: '/var/log' + shouldExist: true +- name: 'cron log file exists' + path: '/var/log/cron.log' + shouldExist: true +- name: 'backup script exists' + path: '/bin/backup' + shouldExist: true +metadataTest: + volumes: ["/data"] + entrypoint: ["/entry.sh"] + cmd: ["tail","-fn0", "/var/log/cron.log"] \ No newline at end of file diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000..364a7b6 --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,9 @@ +version: '2' + +services: + test: + image: gcr.io/gcp-runtimes/container-structure-test + command: ["test", "--image", "restic-backup", "--config", "config.yml"] + volumes: + - ./config.yml:/config.yml + - /var/run/docker.sock:/var/run/docker.sock \ No newline at end of file diff --git a/entry.sh b/entry.sh index 42c3ea5..38fb703 100755 --- a/entry.sh +++ b/entry.sh @@ -43,4 +43,4 @@ crond echo "Container started." -tail -fn0 /var/log/cron.log \ No newline at end of file +exec "$@" \ No newline at end of file