From 59877036318607a1a7c9ae1c52719d7358078174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Fri, 5 Oct 2018 11:51:35 +0300 Subject: [PATCH] Tavis-ci to upload images to the Docker hub, after succesfull tests. For this to work, the following variables will need to be set at Docker hub: - DOCKER_ORG first part of docker repo name (example: mailu) - DOCKER_UN Docker-hub login username (private) - DOCKER_PW Docker-hub login password (private) Note that also Docker hub autobuilds will have to be disabled. --- .travis.yml | 4 ++++ tests/build.yml | 22 +++++++++++----------- tests/deploy.sh | 4 ++++ 3 files changed, 19 insertions(+), 11 deletions(-) create mode 100755 tests/deploy.sh diff --git a/.travis.yml b/.travis.yml index f1d36f3f..9fc1d02f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,3 +11,7 @@ script: - docker-compose -f tests/build.yml -p Mailu build - tests/compose/test-script.sh +deploy: + provider: script + script: bash tests/deploy.sh + diff --git a/tests/build.yml b/tests/build.yml index 674abf8c..a195fdf7 100644 --- a/tests/build.yml +++ b/tests/build.yml @@ -3,45 +3,45 @@ version: '3' services: front: - image: mailu/nginx:$VERSION + image: $DOCKER_ORG/nginx:$VERSION build: ../core/nginx imap: - image: mailu/dovecot:$VERSION + image: $DOCKER_ORG/dovecot:$VERSION build: ../core/dovecot smtp: - image: mailu/postfix:$VERSION + image: $DOCKER_ORG/postfix:$VERSION build: ../core/postfix antispam: - image: mailu/rspamd:$VERSION + image: $DOCKER_ORG/rspamd:$VERSION build: ../services/rspamd antivirus: - image: mailu/clamav:$VERSION + image: $DOCKER_ORG/clamav:$VERSION build: ../optional/clamav webdav: - image: mailu/radicale:$VERSION + image: $DOCKER_ORG/radicale:$VERSION build: ../optional/radicale admin: - image: mailu/admin:$VERSION + image: $DOCKER_ORG/admin:$VERSION build: ../core/admin roundcube: - image: mailu/roundcube:$VERSION + image: $DOCKER_ORG/roundcube:$VERSION build: ../webmails/roundcube rainloop: - image: mailu/rainloop:$VERSION + image: $DOCKER_ORG/rainloop:$VERSION build: ../webmails/rainloop fetchmail: - image: mailu/fetchmail:$VERSION + image: $DOCKER_ORG/fetchmail:$VERSION build: ../services/fetchmail none: - image: mailu/none:$VERSION + image: $DOCKER_ORG/none:$VERSION build: ../core/none diff --git a/tests/deploy.sh b/tests/deploy.sh new file mode 100755 index 00000000..0526a217 --- /dev/null +++ b/tests/deploy.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker login -u $DOCKER_UN -p $DOCKER_PW +docker-compose -f tests/build.yml push