Merge pull request #4 from sartography/chore/github_branches_to_docker_tags
Chore/GitHub branches to docker tags
This commit is contained in:
commit
084c690dbf
|
@ -3,10 +3,6 @@ language: bash
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- COMMIT=${TRAVIS_COMMIT::8}
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- sudo pip install --upgrade pip
|
- sudo pip install --upgrade pip
|
||||||
- pip install --user awscli
|
- pip install --user awscli
|
||||||
|
|
|
@ -5,6 +5,8 @@ echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
||||||
APP="db"
|
APP="db"
|
||||||
REPO="sartography/cr-connect-$APP"
|
REPO="sartography/cr-connect-$APP"
|
||||||
TAG=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "$TRAVIS_BRANCH" ; fi)
|
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 build -f Dockerfile -t "$REPO:$COMMIT" .
|
||||||
docker tag "$REPO:$COMMIT" "$REPO:$TAG"
|
docker tag "$REPO:$COMMIT" "$REPO:$TAG"
|
||||||
docker tag "$REPO:$COMMIT" "$REPO:travis-$TRAVIS_BUILD_NUMBER"
|
docker tag "$REPO:$COMMIT" "$REPO:travis-$TRAVIS_BUILD_NUMBER"
|
||||||
|
|
Loading…
Reference in New Issue