Sends message to DCOS when Docker Hub image is updated

This commit is contained in:
Aaron Louie 2020-04-03 10:15:08 -04:00
parent e1240912bc
commit dbf199ec21
3 changed files with 20 additions and 6 deletions

View File

@ -19,11 +19,19 @@ addons:
script:
- npm run ci
before_deploy:
- docker build -t sartography/cr-connect-bpmn .
after_success:
- pip install --user awscli
- export PATH=$PATH:$HOME/.local/bin
deploy:
provider: script
script: bash ./docker/docker_push.sh
script: bash ./deploy.sh
on:
branch: master
notifications:
email:
on_success: change
on_failure: always
recipients:
- dan@sartography.com

9
deploy.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
# Build and push Docker image to Docker Hub
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker build --no-cache -t sartography/cr-connect-bpmn:latest . || exit 1;
docker push sartography/cr-connect-bpmn:latest || exit 1;
# Notify UVA DCOS that Docker image has been updated
aws sqs send-message --queue-url 'https://queue.amazonaws.com/474683445819/dcos-refresh' --message-body 'crconnect/bpmn' || exit 1;

View File

@ -1,3 +0,0 @@
#!/bin/bash
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push sartography/cr-connect-bpmn || true