From 9af91bed8b8d4fd1096fb400327dcef69e3097f6 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Thu, 7 May 2020 13:49:17 -0400 Subject: [PATCH 1/4] Printing out some stuff for debugging --- .travis.yml | 2 +- deploy.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d5dbd199..dc102e83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ deploy: skip_cleanup: true on: all_branches: true - condition: $TRAVIS_BRANCH =~ ^(testing|staging|master)$ +# condition: $TRAVIS_BRANCH =~ ^(testing|staging|master)$ notifications: email: diff --git a/deploy.sh b/deploy.sh index a4a83231..a1abbca9 100755 --- a/deploy.sh +++ b/deploy.sh @@ -4,6 +4,14 @@ echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin || exit 1 REPO="sartography/cr-connect-workflow" TAG=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "$TRAVIS_BRANCH" ; fi) + +echo "REPO = $REPO" +echo "TAG = $TAG" +echo "COMMIT = $COMMIT" +echo "REPO:COMMIT = $REPO:$COMMIT" +echo "REPO:TAG = $REPO:$TAG" +echo "REPO:travis-TRAVIS_BUILD_NUMBER = $REPO:travis-$TRAVIS_BUILD_NUMBER" + docker build -f Dockerfile -t "$REPO:$COMMIT" . || exit 1 docker tag "$REPO:$COMMIT" "$REPO:$TAG" || exit 1 docker tag "$REPO:$COMMIT" "$REPO:travis-$TRAVIS_BUILD_NUMBER" || exit 1 @@ -16,4 +24,5 @@ sleep 30 # Notify DC/OS that Docker image has been updated echo "Refreshing DC/OS..." STAGE=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "production"; else echo "$TRAVIS_BRANCH" ; fi) +echo "STAGE = $STAGE" aws sqs send-message --region "$AWS_DEFAULT_REGION" --queue-url "$AWS_SQS_URL" --message-body "crconnect/$STAGE/backend" || exit 1 From fceda2c7966893a36b876e2cb64ecc721ab57b66 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Thu, 7 May 2020 14:14:25 -0400 Subject: [PATCH 2/4] Tries defining commit in deploy script --- .travis.yml | 4 ++-- deploy.sh | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc102e83..6bf78fa1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,8 @@ install: - pipenv install env: - global: - - COMMIT=${$TRAVIS_COMMIT::8} +# global: +# - COMMIT=${$TRAVIS_COMMIT::8} matrix: - PB_BASE_URL='http://workflow.sartography.com:5001/pb/' diff --git a/deploy.sh b/deploy.sh index a1abbca9..ab32d745 100755 --- a/deploy.sh +++ b/deploy.sh @@ -4,9 +4,11 @@ echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin || exit 1 REPO="sartography/cr-connect-workflow" TAG=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "$TRAVIS_BRANCH" ; fi) +COMMIT=${$TRAVIS_COMMIT::8} echo "REPO = $REPO" echo "TAG = $TAG" +echo "TRAVIS_COMMIT = $TRAVIS_COMMIT" echo "COMMIT = $COMMIT" echo "REPO:COMMIT = $REPO:$COMMIT" echo "REPO:TAG = $REPO:$TAG" From 06f14daa864b49fea42c3f43aac1b256951f0c14 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Thu, 7 May 2020 14:24:15 -0400 Subject: [PATCH 3/4] Fixes commit substring syntax --- deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index ab32d745..fe987f14 100755 --- a/deploy.sh +++ b/deploy.sh @@ -4,7 +4,7 @@ echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin || exit 1 REPO="sartography/cr-connect-workflow" TAG=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "$TRAVIS_BRANCH" ; fi) -COMMIT=${$TRAVIS_COMMIT::8} +COMMIT=${TRAVIS_COMMIT::8} echo "REPO = $REPO" echo "TAG = $TAG" From a1ad11c07d683cd48e50b92e7f9e9017e3fb930f Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Thu, 7 May 2020 14:27:32 -0400 Subject: [PATCH 4/4] Cleans up debugging stuff --- .travis.yml | 7 ++----- deploy.sh | 8 -------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6bf78fa1..913400c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,10 +22,7 @@ install: - pipenv install env: -# global: -# - COMMIT=${$TRAVIS_COMMIT::8} - matrix: - - PB_BASE_URL='http://workflow.sartography.com:5001/pb/' + - PB_BASE_URL='http://workflow.sartography.com:5001/pb/' script: - pipenv run coverage run -m pytest @@ -40,7 +37,7 @@ deploy: skip_cleanup: true on: all_branches: true -# condition: $TRAVIS_BRANCH =~ ^(testing|staging|master)$ + condition: $TRAVIS_BRANCH =~ ^(testing|staging|master)$ notifications: email: diff --git a/deploy.sh b/deploy.sh index fe987f14..04533e71 100755 --- a/deploy.sh +++ b/deploy.sh @@ -6,14 +6,6 @@ REPO="sartography/cr-connect-workflow" TAG=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "$TRAVIS_BRANCH" ; fi) COMMIT=${TRAVIS_COMMIT::8} -echo "REPO = $REPO" -echo "TAG = $TAG" -echo "TRAVIS_COMMIT = $TRAVIS_COMMIT" -echo "COMMIT = $COMMIT" -echo "REPO:COMMIT = $REPO:$COMMIT" -echo "REPO:TAG = $REPO:$TAG" -echo "REPO:travis-TRAVIS_BUILD_NUMBER = $REPO:travis-$TRAVIS_BUILD_NUMBER" - docker build -f Dockerfile -t "$REPO:$COMMIT" . || exit 1 docker tag "$REPO:$COMMIT" "$REPO:$TAG" || exit 1 docker tag "$REPO:$COMMIT" "$REPO:travis-$TRAVIS_BUILD_NUMBER" || exit 1