Moves commit variable into deploy script

This commit is contained in:
Aaron Louie 2020-05-07 10:25:06 -04:00
parent 827e840103
commit 26251a199f
2 changed files with 1 additions and 3 deletions

View File

@ -24,9 +24,6 @@ install:
env: env:
- PB_BASE_URL='http://workflow.sartography.com:5001/pb/' - PB_BASE_URL='http://workflow.sartography.com:5001/pb/'
global:
- COMMIT=${TRAVIS_COMMIT::8}
script: script:
- pipenv run coverage run -m pytest - pipenv run coverage run -m pytest
- pipenv run coverage xml -i - pipenv run coverage xml -i

View File

@ -4,6 +4,7 @@
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
REPO="sartography/cr-connect-workflow" REPO="sartography/cr-connect-workflow"
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"