Merge pull request #6 from usrpro/feat-travis-deploy

Tavis-ci to upload images to the Docker hub, after succesfull tests.
master
Tim Möhlmann 6 years ago committed by GitHub
commit 9c266cc8e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,3 +11,9 @@ script:
- docker-compose -f tests/build.yml -p Mailu build - docker-compose -f tests/build.yml -p Mailu build
- tests/compose/test-script.sh - tests/compose/test-script.sh
deploy:
provider: script
script: bash tests/deploy.sh
on:
all_branches: true

@ -3,45 +3,45 @@ version: '3'
services: services:
front: front:
image: mailu/nginx:$VERSION image: $DOCKER_ORG/nginx:$VERSION
build: ../core/nginx build: ../core/nginx
imap: imap:
image: mailu/dovecot:$VERSION image: $DOCKER_ORG/dovecot:$VERSION
build: ../core/dovecot build: ../core/dovecot
smtp: smtp:
image: mailu/postfix:$VERSION image: $DOCKER_ORG/postfix:$VERSION
build: ../core/postfix build: ../core/postfix
antispam: antispam:
image: mailu/rspamd:$VERSION image: $DOCKER_ORG/rspamd:$VERSION
build: ../services/rspamd build: ../services/rspamd
antivirus: antivirus:
image: mailu/clamav:$VERSION image: $DOCKER_ORG/clamav:$VERSION
build: ../optional/clamav build: ../optional/clamav
webdav: webdav:
image: mailu/radicale:$VERSION image: $DOCKER_ORG/radicale:$VERSION
build: ../optional/radicale build: ../optional/radicale
admin: admin:
image: mailu/admin:$VERSION image: $DOCKER_ORG/admin:$VERSION
build: ../core/admin build: ../core/admin
roundcube: roundcube:
image: mailu/roundcube:$VERSION image: $DOCKER_ORG/roundcube:$VERSION
build: ../webmails/roundcube build: ../webmails/roundcube
rainloop: rainloop:
image: mailu/rainloop:$VERSION image: $DOCKER_ORG/rainloop:$VERSION
build: ../webmails/rainloop build: ../webmails/rainloop
fetchmail: fetchmail:
image: mailu/fetchmail:$VERSION image: $DOCKER_ORG/fetchmail:$VERSION
build: ../services/fetchmail build: ../services/fetchmail
none: none:
image: mailu/none:$VERSION image: $DOCKER_ORG/none:$VERSION
build: ../core/none build: ../core/none

@ -121,7 +121,7 @@ WEBSITE=https://mailu.io
################################### ###################################
# Docker-compose project name, this will prepended to containers names. # Docker-compose project name, this will prepended to containers names.
COMPOSE_PROJECT_NAME=mailu #COMPOSE_PROJECT_NAME=mailu
# Default password scheme used for newly created accounts and changed passwords # Default password scheme used for newly created accounts and changed passwords
# (value: SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT) # (value: SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)

@ -3,7 +3,7 @@ version: '2'
services: services:
front: front:
image: mailu/nginx:$VERSION image: $DOCKER_ORG/nginx:$VERSION
restart: 'no' restart: 'no'
env_file: $PWD/.env env_file: $PWD/.env
ports: ports:
@ -26,7 +26,7 @@ services:
- "$ROOT/redis:/data" - "$ROOT/redis:/data"
imap: imap:
image: mailu/dovecot:$VERSION image: $DOCKER_ORG/dovecot:$VERSION
restart: 'no' restart: 'no'
env_file: $PWD/.env env_file: $PWD/.env
volumes: volumes:
@ -37,7 +37,7 @@ services:
- front - front
smtp: smtp:
image: mailu/postfix:$VERSION image: $DOCKER_ORG/postfix:$VERSION
restart: 'no' restart: 'no'
env_file: $PWD/.env env_file: $PWD/.env
volumes: volumes:
@ -47,7 +47,7 @@ services:
- front - front
antispam: antispam:
image: mailu/rspamd:$VERSION image: $DOCKER_ORG/rspamd:$VERSION
restart: 'no' restart: 'no'
env_file: $PWD/.env env_file: $PWD/.env
volumes: volumes:
@ -58,21 +58,21 @@ services:
- front - front
antivirus: antivirus:
image: mailu/$ANTIVIRUS:$VERSION image: $DOCKER_ORG/$ANTIVIRUS:$VERSION
restart: 'no' restart: 'no'
env_file: $PWD/.env env_file: $PWD/.env
volumes: volumes:
- "$ROOT/filter:/data" - "$ROOT/filter:/data"
webdav: webdav:
image: mailu/$WEBDAV:$VERSION image: $DOCKER_ORG/$WEBDAV:$VERSION
restart: 'no' restart: 'no'
env_file: $PWD/.env env_file: $PWD/.env
volumes: volumes:
- "$ROOT/dav:/data" - "$ROOT/dav:/data"
admin: admin:
image: mailu/admin:$VERSION image: $DOCKER_ORG/admin:$VERSION
restart: 'no' restart: 'no'
env_file: $PWD/.env env_file: $PWD/.env
volumes: volumes:
@ -83,7 +83,7 @@ services:
- redis - redis
webmail: webmail:
image: "mailu/$WEBMAIL:$VERSION" image: "$DOCKER_ORG/$WEBMAIL:$VERSION"
restart: 'no' restart: 'no'
env_file: $PWD/.env env_file: $PWD/.env
volumes: volumes:
@ -92,7 +92,7 @@ services:
- imap - imap
fetchmail: fetchmail:
image: mailu/fetchmail:$VERSION image: $DOCKER_ORG/fetchmail:$VERSION
restart: 'no' restart: 'no'
env_file: $PWD/.env env_file: $PWD/.env
volumes: volumes:

@ -1,36 +1,36 @@
#!/bin/bash #!/bin/bash
containers=( containers=(
mailu_webmail_1 webmail_1
mailu_imap_1 imap_1
mailu_smtp_1 smtp_1
mailu_antispam_1 antispam_1
mailu_admin_1 admin_1
mailu_redis_1 redis_1
mailu_antivirus_1 antivirus_1
mailu_webdav_1 webdav_1
# mailu_fetchmail_1 # fetchmail_1
mailu_front_1 front_1
) )
containers_check() { containers_check() {
STATUS=0 STATUS=0
for container in "${containers[@]}"; do for container in "${containers[@]}"; do
echo "Checking $container" echo "Checking ${DOCKER_ORG}_${container}"
docker inspect $container | grep '"Status": "running"' || STATUS=1 docker inspect "${DOCKER_ORG}_${container}" | grep '"Status": "running"' || STATUS=1
done done
return $STATUS return $STATUS
} }
container_logs() { container_logs() {
for container in "${containers[@]}"; do for container in "${containers[@]}"; do
echo "Showing logs for $container" echo "Showing logs for ${DOCKER_ORG}_${container}"
docker container logs $container docker container logs "${DOCKER_ORG}_${container}"
done done
} }
for file in tests/compose/*.env ; do for file in tests/compose/*.env ; do
cp $file .env cp $file .env
docker-compose -f tests/compose/run.yml up -d docker-compose -f tests/compose/run.yml -p $DOCKER_ORG up -d
sleep 1m sleep 1m
docker ps docker ps
container_logs container_logs

@ -0,0 +1,4 @@
#!/bin/bash
docker login -u $DOCKER_UN -p $DOCKER_PW
docker-compose -f tests/build.yml push
Loading…
Cancel
Save