From 4439b52f80277ce7478a266455b243e02043e2e1 Mon Sep 17 00:00:00 2001 From: admire Date: Sun, 19 Apr 2020 13:34:20 +0200 Subject: [PATCH] fix travis --- .travis.yml | 5 ++++- Dockerfile.test | 16 ++++++++++++++++ build-test.sh | 5 +++++ docker-compose.override.travis.yml | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.test create mode 100644 build-test.sh diff --git a/.travis.yml b/.travis.yml index 49d060c..50e3125 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ env: script: - ls -lah - - docker-compose up -d --build dbbackup + - docker-compose up -d - docker-compose ps - docker-compose exec dbbackup /bin/bash -c "until psql -l; do echo 'db unavailable. sleeping'; sleep 1; done" - docker-compose exec dbbackup ls @@ -24,6 +24,9 @@ script: - docker-compose exec dbbackup /restore.sh - docker-compose exec dbbackup psql -l gis +before_script: + - ./build-test.sh + notifications: irc: channels: diff --git a/Dockerfile.test b/Dockerfile.test new file mode 100644 index 0000000..98affab --- /dev/null +++ b/Dockerfile.test @@ -0,0 +1,16 @@ +FROM kartoza/postgis:12.1 +MAINTAINER tim@kartoza.com + +RUN apt-get -y update; apt-get -y --no-install-recommends install postgresql-client cron +RUN touch /var/log/cron.log + +COPY backups-cron /backups-cron +COPY backups.sh /backups.sh +COPY restore.sh /restore.sh +COPY start.sh /start.sh +RUN chmod 0755 /*.sh + +ENTRYPOINT ["/bin/bash", "/start.sh"] +CMD ["/docker-entrypoint.sh"] + + diff --git a/build-test.sh b/build-test.sh new file mode 100644 index 0000000..3a1b070 --- /dev/null +++ b/build-test.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +./build.sh + +docker build -t kartoza/pg-backup:12.0 -f Dockerfile.test . diff --git a/docker-compose.override.travis.yml b/docker-compose.override.travis.yml index f709b8f..901c35c 100644 --- a/docker-compose.override.travis.yml +++ b/docker-compose.override.travis.yml @@ -3,6 +3,7 @@ version: '2.1' services: dbbackup: + image: kartoza/pg-backup:12.0 environment: # Postgres environment variable # Can be set to execute PG tools directly