Skip to content

Commit 7349d46

Browse files
author
Amir Moualem
authored
Merge pull request #109 from snyk/chore/refactors
Chore/refactors
2 parents 0635879 + 2e63a92 commit 7349d46

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ jobs:
4040
name: Test and Build
4141
- stage: tag-and-push
4242
if: branch = staging AND type = push
43-
script: npx semantic-release &&
43+
script: docker login --username ${DOCKERHUB_USER} --password ${DOCKERHUB_PASSWORD} &&
44+
npx semantic-release &&
4445
NEW_VERSION=`cat ./package.json | jq -r '.version'` &&
4546
./scripts/approve-image.sh $NEW_VERSION ||
4647
( ./scripts/slack-notify-failure.sh "staging-release" && false )

scripts/approve-image.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
# then it would be null
66
if [ $1 == "null" ]; then
77
echo Semantic-Release did not create a new version, not pushing a new approved image
8+
./scripts/slack-notify-success-no-release.sh
89
else
910
IMAGE_NAME_CANDIDATE=snyk/kubernetes-monitor:staging-candidate
1011
IMAGE_NAME_APPROVED=snyk/kubernetes-monitor:${1}-approved
1112

12-
docker pull ${IMAGE_NAME_CANDIDATE}
13-
docker tag ${IMAGE_NAME_CANDIDATE} ${IMAGE_NAME_APPROVED}
14-
docker push ${IMAGE_NAME_APPROVED}
13+
docker pull ${IMAGE_NAME_CANDIDATE} &&
14+
docker tag ${IMAGE_NAME_CANDIDATE} ${IMAGE_NAME_APPROVED} &&
15+
docker push ${IMAGE_NAME_APPROVED} &&
1516
./scripts/slack-notify-push.sh ${IMAGE_NAME_APPROVED}
1617
fi
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#! /bin/bash
2+
curl -X POST -H 'Content-Type:application/json' -d '{"attachments": [{"color": "warning", "fallback": "Build Notification: $TRAVIS_BUILD_WEB_URL", "title": "Kubernetes-Monitor Publish Notification", "text": ":egg_fancy: Successful `staging` merge, but no semantic-release occurring :egg_fancy:"}]}' $SLACK_WEBHOOK

0 commit comments

Comments
 (0)