2020-04-03 14:26:12 +00:00
|
|
|
language: bash
|
|
|
|
|
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
|
2020-05-06 20:57:08 +00:00
|
|
|
env:
|
|
|
|
global:
|
|
|
|
- COMMIT=${TRAVIS_COMMIT::8}
|
|
|
|
|
2020-04-03 14:26:12 +00:00
|
|
|
before_install:
|
|
|
|
- sudo pip install --upgrade pip
|
|
|
|
- pip install --user awscli
|
|
|
|
- export PATH=$PATH:$HOME/.local/bin
|
2020-04-03 15:12:36 +00:00
|
|
|
- echo $DOCKER_TOKEN | docker login -u "$DOCKER_USERNAME" --password-stdin
|
2020-04-03 14:26:12 +00:00
|
|
|
|
|
|
|
install:
|
2020-05-06 20:57:08 +00:00
|
|
|
- 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 20:57:08 +00:00
|
|
|
- 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'
|
2020-04-03 14:26:12 +00:00
|
|
|
|
|
|
|
notifications:
|
|
|
|
email:
|
|
|
|
on_success: change
|
|
|
|
on_failure: always
|
|
|
|
recipients:
|
|
|
|
- dan@sartography.com
|
|
|
|
|