From dbf199ec211f2d8377fa27d193d91b429d95abd6 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Fri, 3 Apr 2020 10:15:08 -0400 Subject: [PATCH] Sends message to DCOS when Docker Hub image is updated --- .travis.yml | 14 +++++++++++--- deploy.sh | 9 +++++++++ docker/docker_push.sh | 3 --- 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100755 deploy.sh delete mode 100755 docker/docker_push.sh diff --git a/.travis.yml b/.travis.yml index 32bf1b2..67063d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..6160469 --- /dev/null +++ b/deploy.sh @@ -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; diff --git a/docker/docker_push.sh b/docker/docker_push.sh deleted file mode 100755 index 2809414..0000000 --- a/docker/docker_push.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin -docker push sartography/cr-connect-bpmn || true