22 lines
580 B
Bash
Executable File
22 lines
580 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Passed variable. May be SUCCESS or FAILURE value
|
|
BUILD_RESULT=$1
|
|
|
|
MESSAGE=""
|
|
RESULT=""
|
|
if [ "$BUILD_RESULT" != "SUCCESS" ]; then
|
|
MESSAGE="*Failed*"
|
|
RESULT=":no_entry:"
|
|
else
|
|
RELEASE_NOTES=$(git log -5 --pretty=format:"%h (%cn) %s")
|
|
MESSAGE="sent to TestFlight \`\`\`$RELEASE_NOTES\`\`\`"
|
|
RESULT=":white_check_mark:"
|
|
fi
|
|
|
|
|
|
curl \
|
|
-X POST \
|
|
-H "Content-Type: application/json" \
|
|
--data "{\"username\": \"$K8S_SLACK_BOT_NAME\", \"text\": \"$RESULT :iphone: *iOS* build *$CI_PIPELINE_IID* from branch *$CI_COMMIT_BRANCH* $MESSAGE\"}" \
|
|
$K8S_SLACK_WEBHOOK |