Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
digdag error post
#!/bin/sh
if [[ 'prd' == $DIGDAG_ENV ]] ; then
body=$1
room_id=$2
if [ -z $room_id ]; then
room_id=xxxxxxxxxx
fi
/usr/bin/curl -X POST -H "X-ChatWorkToken:xxxxxxxxxxxx" -d "body=$body" "https://api.chatwork.com/v2/rooms/$room_id/messages"
fi
#!/bin/bash
url='https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxxxxxxxxxxxx'
username='DigDag'
to="sre"
subject='FAILED'
emoji=':digdag:'
message="$1"
color="#FF0000"
payload="payload={
\"channel\": \"${to}\",
\"username\": \"${username}\",
\"text\": \"${subject}\",
\"icon_emoji\": \"${emoji}\",
\"attachments\": [
{
\"color\" : \"${color}\",
\"text\" : \"${message}\"
}
]
}"
curl -m 5 --data-urlencode "${payload}" $url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment