Fix deploy script (#173)

Fix the deploy script and deploy script and push rolling releases only when cron jobs run.
This commit is contained in:
Abhilash Raj
2017-11-03 19:44:29 -07:00
committed by GitHub
parent 3434446987
commit f3411fa3ee

View File

@@ -1,10 +1,18 @@
#!/bin/sh
if [[ "$TRAVIS_BRANCH" == "master" ]]
then
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
docker push maxking/mailman-web
docker push maxking/mailman-core
function deploy {
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
docker push maxking/mailman-web:$1
docker push maxking/mailman-core:$1
}
if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then
deploy "rolling"
elif [ "$TRAVIS_BRANCH" = "master" ]; then
deploy "latest"
else
echo "Non-master branch aren't pushed to DockerHub..."
# If the branch isn't master and this was not a cron job, no need to deploy.
echo "TRAVIS_EVENT_TYPE = $TRAVIS_EVENT_TYPE, TRAVIS_BRANCH = $TRAVIS_BRANCH"
exit 0
fi