Skip to content

Commit 6e6a3e3

Browse files
committed
[ci] Fixed Slack messages
1 parent 4355e46 commit 6e6a3e3

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

scripts/commit_upm.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ if [ $COMMIT_STATUS -eq 1 ]
4040
then
4141
# Nothing to commit.
4242
echo "<<< Nothing to commit."
43-
echo "Exiting... Nothing new anyways."
44-
exit 0
4543
elif [ $COMMIT_STATUS -ne 0 ]
4644
then
4745
echo "<<< Unexpected error during commit. Aborting."

scripts/slack_notify_github_deploy.sh

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,13 @@ function getAuthorFields {
8080
}
8181

8282
author=""
83-
text="*Project: `$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME` Branch: `$CIRCLE_BRANCH`*"
83+
text="*Project: \`$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME\` Branch: \`$CIRCLE_BRANCH\`*"
8484
fields=""
8585
actions=""
8686

87+
echo "BUILD_STATUS='$BUILD_STATUS'"
88+
echo "DEPLOY_STATUS='$DEPLOY_STATUS'"
89+
8790
if [[ "$BUILD_STATUS" == "success" ]]
8891
then
8992
if [[ "$DEPLOY_STATUS" == "success" ]]
@@ -101,34 +104,36 @@ then
101104
}
102105
"
103106
if [[ "$DEPLOY_TAG_MELLIS" ]]; then
104-
mellisTagText="(tag: <https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/releases/tag/$DEPLOY_TAG_MELLIS|$DEPLOY_TAG_MELLIS>)"
107+
mellisTagText="_(tag: <https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/releases/tag/$DEPLOY_TAG_MELLIS|$DEPLOY_TAG_MELLIS>)_"
105108
else
106-
mellisTagText="(no new tag)"
109+
mellisTagText="_(no new tag)_"
107110
fi
108111
if [[ "$DEPLOY_TAG_PYTHON3" ]]; then
109-
python3TagText="(tag: <https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/releases/tag/$DEPLOY_TAG_PYTHON3|$DEPLOY_TAG_PYTHON3>)"
112+
python3TagText="_(tag: <https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/releases/tag/$DEPLOY_TAG_PYTHON3|$DEPLOY_TAG_PYTHON3>)_"
110113
else
111-
python3TagText="(no new tag)"
114+
python3TagText="_(no new tag)_"
112115
fi
113116
fields="{
114117
\"title\": \"Mellis\",
115-
\"value\": \"```$MELLIS_VERSION```\\n$mellisTagText\",
118+
\"value\": \"\`\`\`$MELLIS_VERSION\`\`\`\\n$mellisTagText\",
116119
\"short\": true
117120
},
118121
{
119122
\"title\": \"Python3 module\",
120-
\"value\": \"```$MELLIS_PYTHON3_VERSION```\\n$python3TagText\",
123+
\"value\": \"\`\`\`$MELLIS_PYTHON3_VERSION\`\`\`\\n$python3TagText\",
121124
\"short\": true
122125
}"
123-
elif [[ "$DEPLOY_STATUS" == "idle" ]]
124-
then
126+
else
127+
echo "Nothing to deploy 'eh?"
125128
# Nothing to deploy
126-
color="#3AA3E3" # blue
129+
#color="#3AA3E3" # blue
130+
color="" # slack defaults to gray
127131
visitJobActionStyle="default" # gray
128132
title="NOTHING TO DEPLOY"
129133
text="$text\\n_No new tags_"
130134
fi
131135
else
136+
# Build failed
132137
color="#ed5c5c" # red
133138
visitJobActionStyle="danger" # red
134139
title=":no_entry_sign: DEPLOYMENT JOB FAILED"
@@ -168,7 +173,8 @@ then
168173
echo "Job completed successfully. Alert sent."
169174
else
170175
echo "Something went wrong in the webhook..."
171-
echo "Payload:"
172-
echo
173-
echo "$data"
174176
fi
177+
178+
echo "Payload:"
179+
echo
180+
echo "$data"

scripts/slack_notify_testrunner.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ else
176176
text="$commitCount commits _(oldest first):_\\n$text"
177177
fi
178178

179-
text="*`Project: $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME, Branch: $CIRCLE_BRANCH`*\\n$text"
179+
text="*Project: \`$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME\` Branch: \`$CIRCLE_BRANCH\`*\\n$text"
180180

181181
footer="$(git diff --shortstat $commitRange)"
182182
testPercent=$((100*TEST_PASSED/TEST_TOTAL))

0 commit comments

Comments
 (0)