Skip to content

Commit e0367e6

Browse files
committed
build without issues message
1 parent 6f1cd8a commit e0367e6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

live-demo/deploy/buildSlackNotify.sh

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

33
env
4+
# if CI_STEP_STATUS is success, then output to slack, that `npm run build` was successful
45

6+
if [ "$CI_STEP_STATUS" = "success" ]; then
7+
MESSAGE="Did a build without issues on \`$CI_REPO_NAME/$CI_COMMIT_BRANCH\`. (<$CI_COMMIT_URL|$CI_COMMIT_SHA>)"
8+
9+
curl -s -X POST -H "Content-Type: application/json" -d '{
10+
"username": "'"$CI_COMMIT_AUTHOR"'",
11+
"icon_url": "'"$CI_COMMIT_AUTHOR_AVATAR"'",
12+
"attachments": [
13+
{
14+
"mrkdwn_in": ["text", "pretext"],
15+
"color": "#8A1C12",
16+
"text": "'"$MESSAGE"'",
17+
"pretext": "'"$MESSAGE"'"
18+
}
19+
]
20+
}' "$DEVELOPERS_SLACK_WEBHOOK"
21+
exit 0
22+
fi
523
export BUILD_LOG=$(cat ../../adminforth/build.log)
624

725
COMMIT_SHORT_SHA=$(echo $CI_COMMIT_SHA | cut -c1-8)

0 commit comments

Comments
 (0)