[fix-hyper-vendor] update hypercli in vendor

This commit is contained in:
Jimmy Xu
2018-01-05 12:32:03 +00:00
committed by Robbie Zhang
parent e050fea889
commit 0e123c783b
21 changed files with 726 additions and 3 deletions

View 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