Created
September 8, 2017 19:10
-
-
Save anthony2025/c857e073c6dacd4ea1f6cefe72d2112a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "requesting email notification, it might take a few minutes to arrive" | |
# indentation is weird on this function | |
generate_email_parameters() { | |
cat <<EOF | |
{ | |
"userEmail": "$USER_EMAIL", | |
"jobName": "$JOB_NAME", | |
"startTime": "$START_TIME", | |
"endTime": "$END_TIME", | |
"exitCode": "$EXIT_CODE" | |
} | |
EOF | |
} | |
curl -i \ | |
-H "Accept: application/json" \ | |
-H "Content-Type:application/json" \ | |
-H "Authorization:$TOKEN" \ | |
-X POST --data "$(generate_email_parameters)" "https:/api/email/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment