37
37
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" &&
38
38
nvm install v10 &&
39
39
npm install &&
40
- npm run test:apk ||
41
- (./scripts/slack-notify-failure.sh "APK regression test" && false)
40
+ npm run test:apk
41
+ - run :
42
+ name : Notify Slack on failure
43
+ command : ./scripts/slack-notify-failure.sh "apk-tests"
44
+ when : on_fail
42
45
43
46
package_manager_test_apt :
44
47
<< : *default_machine_config
51
54
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" &&
52
55
nvm install v10 &&
53
56
npm install &&
54
- npm run test:apt ||
55
- (./scripts/slack-notify-failure.sh "APT regression test" && false)
56
-
57
+ npm run test:apt
58
+ - run :
59
+ name : Notify Slack on failure
60
+ command : ./scripts/slack-notify-failure.sh "apt-tests"
61
+ when : on_fail
57
62
package_manager_test_rpm :
58
63
<< : *default_machine_config
59
64
steps :
65
70
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" &&
66
71
nvm install v10 &&
67
72
npm install &&
68
- npm run test:rpm ||
69
- (./scripts/slack-notify-failure.sh "RPM regression test" && false)
73
+ npm run test:rpm
74
+ - run :
75
+ name : Notify Slack on failure
76
+ command : ./scripts/slack-notify-failure.sh "rpm-tests"
77
+ when : on_fail
70
78
71
79
# ####################### PR TO STAGING ########################
72
80
test_discardable :
@@ -102,8 +110,11 @@ jobs:
102
110
./scripts/build-image.sh ${IMAGE_NAME_CANDIDATE} &&
103
111
docker push ${IMAGE_NAME_CANDIDATE} &&
104
112
./scripts/slack-notify-push.sh ${IMAGE_NAME_CANDIDATE} &&
105
- KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=${IMAGE_NAME_CANDIDATE} npm run test:integration ||
106
- ( ./scripts/slack-notify-failure.sh "staging-test" && false )
113
+ KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=${IMAGE_NAME_CANDIDATE} npm run test:integration
114
+ - run :
115
+ name : Notify Slack on failure
116
+ command : ./scripts/slack-notify-failure.sh "staging-test"
117
+ when : on_fail
107
118
tag_and_push :
108
119
<< : *default_container_config
109
120
steps :
@@ -120,8 +131,11 @@ jobs:
120
131
unset CIRCLE_PULL_REQUESTS &&
121
132
npx semantic-release &&
122
133
NEW_VERSION=`cat ./package.json | jq -r '.version'` &&
123
- ./scripts/approve-image.sh $NEW_VERSION ||
124
- ( ./scripts/slack-notify-failure.sh "staging-release" && false )
134
+ ./scripts/approve-image.sh $NEW_VERSION
135
+ - run :
136
+ name : Notify Slack on failure
137
+ command : ./scripts/slack-notify-failure.sh "staging-release"
138
+ when : on_fail
125
139
deploy_dev :
126
140
<< : *default_container_config
127
141
steps :
@@ -136,6 +150,10 @@ jobs:
136
150
-X POST -d "{\"docker_sha\":\"${LATEST_TAG}\", \
137
151
\"commit_hash\":\"${CIRCLE_SHA1}\"}" \
138
152
https://my.dev.snyk.io/${DEV_DEPLOY_TOKEN}
153
+ - run :
154
+ name : Notify Slack on failure
155
+ command : ./scripts/slack-notify-failure.sh "deploy-dev"
156
+ when : on_fail
139
157
140
158
# ####################### PR TO MASTER ########################
141
159
prepublish :
@@ -165,8 +183,11 @@ jobs:
165
183
docker tag ${IMAGE_NAME_APPROVED} ${IMAGE_NAME_PUBLISHED} &&
166
184
docker push ${IMAGE_NAME_PUBLISHED} &&
167
185
./scripts/slack-notify-push.sh ${IMAGE_NAME_PUBLISHED} &&
168
- ./scripts/publish-gh-pages.sh ${LATEST_TAG} ||
169
- ( ./scripts/slack-notify-failure.sh master && false )
186
+ ./scripts/publish-gh-pages.sh ${LATEST_TAG}
187
+ - run :
188
+ name : Notify Slack on failure
189
+ command : ./scripts/slack-notify-failure.sh "master"
190
+ when : on_fail
170
191
171
192
deploy_prod :
172
193
<< : *default_container_config
@@ -181,6 +202,10 @@ jobs:
181
202
curl -i -H "Accept: application/json" -H "Content-Type: application/json" \
182
203
-X POST -d "{}" \
183
204
https://my.prod.snyk.io/${PROD_DEPLOY_TOKEN}
205
+ - run :
206
+ name : Notify Slack on failure
207
+ command : ./scripts/slack-notify-failure.sh "deploy-prod"
208
+ when : on_fail
184
209
185
210
# ######################################################################
186
211
0 commit comments