cr-connect-db/.travis.yml

35 lines
1010 B
YAML
Raw Normal View History

language: bash
services:
- docker
env:
global:
- COMMIT=${TRAVIS_COMMIT::8}
before_install:
- sudo pip install --upgrade pip
- pip install --user awscli
- export PATH=$PATH:$HOME/.local/bin
- echo $DOCKER_TOKEN | docker login -u "$DOCKER_USERNAME" --password-stdin
install:
- export REPO=sartography/cr-connect-db
2020-05-06 21:01:47 +00:00
- export TAG=`if [$TRAVIS_BRANCH == "master"]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
2020-05-06 21:01:11 +00:00
- docker build --build-arg GIT_COMMIT="$REPO:$COMMIT" -f Dockerfile -t $REPO:$COMMIT .
2020-05-06 21:04:51 +00:00
- echo "REPO:TAG = $REPO:$TAG"
- echo "$REPO:$COMMIT = $REPO:$TAG"
- echo "$REPO:travis-$TRAVIS_BUILD_NUMBER"
- docker tag $REPO:$COMMIT $REPO:$TAG
- docker tag $REPO:$COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER
- docker push $REPO
- aws sqs send-message --region '$AWS_DEFAULT_REGION' --queue-url '$AWS_SQS_URL' --message-body 'crconnect/$TRAVIS_BRANCH/db'
notifications:
email:
on_success: change
on_failure: always
recipients:
- dan@sartography.com