docker-python/deploy.sh

14 lines
406 B
Bash
Raw Normal View History

#!/bin/bash
function branch_to_tag () {
2020-06-12 21:04:04 +00:00
if [ "$1" == "master" ]; then echo "latest"; else echo "$1" ; fi
}
2020-06-12 20:49:41 +00:00
REPO="sartography/cr-connect-python-base"
TAG=$(branch_to_tag "$TRAVIS_BRANCH")
# Build and push Docker image to Docker Hub
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin || exit 1
docker build -f Dockerfile -t "$REPO:$TAG" . || exit 1
docker push "$REPO" || exit 1