Skip to content

Commit 281b16a

Browse files
committed
cleanup failToSlack.sh, exit from wp only if non 0
1 parent ae5300c commit 281b16a

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

live-demo/deploy/.woodpecker.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ steps:
1616
commands:
1717
- cd adminforth
1818
- npm clean-install
19-
- npm run build 2>&1 | tee build.log; exit $${PIPESTATUS[0]}
19+
- npm run build 2>&1 | tee build.log; [ $${PIPESTATUS[0]} -ne 0 ] && exit $${PIPESTATUS[0]}
2020
- npm audit signatures
2121
- npx semantic-release
2222
secrets:
@@ -25,19 +25,6 @@ steps:
2525
- SLACK_WEBHOOK
2626

2727
slack-on-failure:
28-
# image: plugins/slack
29-
# when:
30-
# - status: failure
31-
# event: push
32-
# - event: push
33-
# settings:
34-
# webhook:
35-
# from_secret: DEVELOPERS_SLACK_WEBHOOK
36-
# username: ${CI_COMMIT_AUTHOR}
37-
# icon_url: ${CI_COMMIT_AUTHOR_AVATAR}
38-
# template: >
39-
# Broke the {{repo.name}}/{{build.branch}} after {{since build.started}} (<{{build.link}}|Open>) ```{{ ${CI_COMMIT_AUTHOR_AVATAR} }}``` 3
40-
4128
# use curl because the plugin can't interpolate template
4229
image: curlimages/curl
4330
when:

live-demo/deploy/failToSlack.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
#!/bin/sh
22

3-
# print env
4-
env
5-
6-
# write the build log to a file, ../../adminforth/build.log
73
export BUILD_LOG=$(cat ../../adminforth/build.log)
84

9-
10-
# CI_COMMIT_SHA is full commit
115
COMMIT_SHORT_SHA=$(echo $CI_COMMIT_SHA | cut -c1-8)
126

137
MESSAGE="Broke \`$CI_REPO_NAME/$CI_COMMIT_BRANCH\` with commit (<$CI_COMMIT_URL|$COMMIT_SHORT_SHA>)."

0 commit comments

Comments
 (0)