Merge pull request #37 from sartography/chore/github_branches_to_docker_tags
Chore/GitHub branches to docker tags
This commit is contained in:
commit
7463664ae0
|
@ -22,7 +22,10 @@ install:
|
||||||
- pipenv install
|
- pipenv install
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- PB_BASE_URL='http://workflow.sartography.com:5001/pb/'
|
global:
|
||||||
|
- COMMIT=${$TRAVIS_COMMIT::8}
|
||||||
|
matrix:
|
||||||
|
- PB_BASE_URL='http://workflow.sartography.com:5001/pb/'
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- pipenv run coverage run -m pytest
|
- pipenv run coverage run -m pytest
|
||||||
|
|
13
deploy.sh
13
deploy.sh
|
@ -1,14 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Build and push Docker image to Docker Hub
|
# Build and push Docker image to Docker Hub
|
||||||
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin || exit 1
|
||||||
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" . || exit 1
|
||||||
docker build -f Dockerfile -t "$REPO:$COMMIT" .
|
docker tag "$REPO:$COMMIT" "$REPO:$TAG" || exit 1
|
||||||
docker tag "$REPO:$COMMIT" "$REPO:$TAG"
|
docker tag "$REPO:$COMMIT" "$REPO:travis-$TRAVIS_BUILD_NUMBER" || exit 1
|
||||||
docker tag "$REPO:$COMMIT" "$REPO:travis-$TRAVIS_BUILD_NUMBER"
|
docker push "$REPO" || exit 1
|
||||||
docker push "$REPO"
|
|
||||||
|
|
||||||
# Wait for Docker Hub
|
# Wait for Docker Hub
|
||||||
echo "Publishing to Docker Hub..."
|
echo "Publishing to Docker Hub..."
|
||||||
|
@ -17,4 +16,4 @@ sleep 30
|
||||||
# Notify DC/OS that Docker image has been updated
|
# Notify DC/OS that Docker image has been updated
|
||||||
echo "Refreshing DC/OS..."
|
echo "Refreshing DC/OS..."
|
||||||
STAGE=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "production"; else echo "$TRAVIS_BRANCH" ; fi)
|
STAGE=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "production"; else echo "$TRAVIS_BRANCH" ; fi)
|
||||||
aws sqs send-message --region "$AWS_DEFAULT_REGION" --queue-url "$AWS_SQS_URL" --message-body "crconnect/$STAGE/backend"
|
aws sqs send-message --region "$AWS_DEFAULT_REGION" --queue-url "$AWS_SQS_URL" --message-body "crconnect/$STAGE/backend" || exit 1
|
||||||
|
|
Loading…
Reference in New Issue