Skip to content

Instantly share code, notes, and snippets.

@Jimmy-Xu
Last active October 10, 2017 08:02
Show Gist options
  • Save Jimmy-Xu/e54f14191e6043646c6b34697b58214a to your computer and use it in GitHub Desktop.
Save Jimmy-Xu/e54f14191e6043646c6b34697b58214a to your computer and use it in GitHub Desktop.
do_test_hyperd.sh
#!/bin/bash
hack/test-cmd.sh
rlt=$?
#################
END_TS=`date '+%s'`
echo "Duration: $((END_TS - START_TS)) (seconds)"
###############################################
if [ $rlt -eq 0 ]
then
icon=":smile:"
else
icon=":scream:"
fi
MESSAGE="*$TITLE* :$icon (http://ci.hypercontainer.io:8080/job/${JOB_NAME}/${BUILD_NUMBER}/console) ${COMMITTER}"
DURATION=$((END_TS - START_TS))" sec"
ATTACHMENT="[{'text':'BEGIN_TIME: $BEGIN_TIME'},{'text':'DURATION: $DURATION'},{'text':'TEST_RESULT: $rlt'}]"
# send end message to slack
./slack.sh "$slack_token" "${SLACK_CHANNEL_ID}" "${MESSAGE}" "${ATTACHMENT}"
exit $rlt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment