authelia/scripts/authelia-scripts-docker-publish
Clement Michaud 76fa325f08 [BREAKING] Create a suite for kubernetes tests.
Authelia client uses hash router instead of browser router in order to work
with Kubernetes nginx-ingress-controller. This is also better for users having
old browsers.

This commit is breaking because it requires to change the configuration of the
proxy to include the # in the URL of the login portal.
2019-03-16 00:13:27 +01:00

43 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Parameters:
# TAG - The name of the tag to use for publishing in Dockerhub
function login_to_dockerhub {
echo "Logging in to Dockerhub as $DOCKER_USERNAME."
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
if [ "$?" -ne "0" ];
then
echo "Logging in to Dockerhub failed.";
exit 1
fi
}
function deploy_on_dockerhub {
TAG=$1
IMAGE_NAME=authelia:dist
DOCKERHUB_IMAGE_NAME=clems4ever/authelia
IMAGE_WITH_TAG=$DOCKERHUB_IMAGE_NAME:$TAG
echo "==========================================================="
echo "Docker image $IMAGE_WITH_TAG will be deployed on Dockerhub."
echo "==========================================================="
docker tag $IMAGE_NAME $IMAGE_WITH_TAG;
docker push $IMAGE_WITH_TAG;
echo "Docker image deployed successfully."
}
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo "Building on master branch"
login_to_dockerhub
deploy_on_dockerhub master
elif [ ! -z "$TRAVIS_TAG" ]; then
login_to_dockerhub
deploy_on_dockerhub $TRAVIS_TAG
deploy_on_dockerhub latest
else
echo "Docker image will not be deployed on Dockerhub."
fi