Merge pull request #4 from sartography/chore/github_branches_to_docker_tags

Chore/GitHub branches to docker tags
This commit is contained in:
Aaron Louie 2020-05-07 14:57:46 -04:00 committed by GitHub
commit 084c690dbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -3,10 +3,6 @@ language: bash
services:
- docker
env:
global:
- COMMIT=${TRAVIS_COMMIT::8}
install:
- sudo pip install --upgrade pip
- pip install --user awscli

View File

@ -5,6 +5,8 @@ echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
APP="db"
REPO="sartography/cr-connect-$APP"
TAG=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "$TRAVIS_BRANCH" ; fi)
COMMIT=${TRAVIS_COMMIT::8}
docker build -f Dockerfile -t "$REPO:$COMMIT" .
docker tag "$REPO:$COMMIT" "$REPO:$TAG"
docker tag "$REPO:$COMMIT" "$REPO:travis-$TRAVIS_BUILD_NUMBER"