Files
OSIT-Mailman3/.travis/deploy.sh
Abhilash Raj d9c5d6ef95 Quote the variables. (#255)
* Quote the variables.

* test using images without repo url.
2018-07-03 21:27:30 -07:00

28 lines
741 B
Bash

#! /bin/bash
USER=maxking
deploy() {
URL="$1"
TAG="$2"
PASSWORD="$3"
# Tag the containers correctly.
docker tag maxking/mailman-core "$URL/maxking/mailman-core:$TAG"
docker tag maxking/mailman-web "$URL/maxking/mailman-web:$TAG"
docker tag maxking/postorius "$URL/maxking/postorius:$TAG"
# Login to the registry and push.
docker login -u $USER -p ${!PASSWORD} $URL
docker push "$URL/maxking/mailman-web:$TAG"
docker push "$URL/maxking/mailman-core:$TAG"
docker push "$URL/maxking/postorius:$TAG"
}
if [ ! "$BRANCH" = "master" ] && [ "$PULL_REQUEST" ]; then
echo "Deploy only from master branch. This is $TRAVIS_BRANCH"
exit 0
fi
deploy "quay.io" "rolling" "$DOCKER_PASSWORD"
deploy "docker.io" "rolling" "$QUAY_PASSWORD"