[fix-hyper-vendor] update hypercli in vendor
This commit is contained in:
28
vendor/github.com/hyperhq/hypercli/integration-cli/autotest/script/slack.sh
generated
vendored
Executable file
28
vendor/github.com/hyperhq/hypercli/integration-cli/autotest/script/slack.sh
generated
vendored
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ "${SLACK_TOKEN}" == "" -o "${SLACK_CHANNEL_ID}" == "" ];then
|
||||
echo "SLACK_TOKEN or SLACK_CHANNEL_ID is unset, skip send slack message"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
NICK="HykinsBot"
|
||||
EMOJI=":jenkins:"
|
||||
|
||||
MESSAGE="$1"
|
||||
ATTACHMENT="$2"
|
||||
|
||||
curl -X POST \
|
||||
-F token=${SLACK_TOKEN} \
|
||||
-F channel=${SLACK_CHANNEL_ID} \
|
||||
-F "text=${MESSAGE}" \
|
||||
-F username=$NICK \
|
||||
-F "attachments=${ATTACHMENT}" \
|
||||
-F "icon_emoji=${EMOJI}" \
|
||||
https://slack.com/api/chat.postMessage
|
||||
|
||||
echo
|
||||
if [ $? -eq 0 ];then
|
||||
echo "send slack message OK :)"
|
||||
else
|
||||
echo "send slack message FAILED :("
|
||||
fi
|
||||
Reference in New Issue
Block a user