2017-06-02 03:16:19 +07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ "$TRAVIS_BRANCH" == "master" ]; then
|
2017-06-02 03:35:37 +07:00
|
|
|
echo "======================================="
|
|
|
|
echo "Authelia will be deployed on Dockerhub."
|
|
|
|
echo "======================================="
|
|
|
|
echo "TRAVIS_TAG='$TRAVIS_TAG'"
|
2017-06-02 03:32:35 +07:00
|
|
|
|
2017-06-02 03:35:37 +07:00
|
|
|
TAG=latest
|
2017-06-02 03:16:19 +07:00
|
|
|
if [ ! -z "$TRAVIS_TAG" ]; then
|
|
|
|
TAG=$TRAVIS_TAG
|
|
|
|
fi
|
|
|
|
|
2017-06-02 03:22:48 +07:00
|
|
|
IMAGE_NAME=clems4ever/authelia
|
2017-06-02 03:32:35 +07:00
|
|
|
IMAGE_WITH_TAG=$IMAGE_NAME:$TAG
|
2017-06-02 03:22:48 +07:00
|
|
|
|
2017-06-02 03:32:35 +07:00
|
|
|
echo "Login to Dockerhub."
|
2017-06-02 03:16:19 +07:00
|
|
|
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
|
2017-06-02 03:32:35 +07:00
|
|
|
|
|
|
|
echo "Docker image $IMAGE_WITH_TAG will be deployed on Dockerhub."
|
|
|
|
docker tag $IMAGE_NAME $IMAGE_WITH_TAG;
|
|
|
|
docker push $IMAGE_WITH_TAG;
|
|
|
|
echo "Docker image deployed successfully."
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "Docker image will not be deployed on Dockerhub."
|
2017-06-02 03:16:19 +07:00
|
|
|
fi
|
|
|
|
|