mirror of
https://github.com/pret/pokediamond.git
synced 2026-08-28 03:34:38 -05:00
Add post_failed.sh webhook
This commit is contained in:
@@ -34,3 +34,6 @@ notifications:
|
||||
|
||||
after_success:
|
||||
- .travis/calcrom/webhook.sh pokediamond
|
||||
|
||||
after_failure:
|
||||
- .travis/post_failed.sh pokediamond
|
||||
|
||||
8
.travis/post_failed.sh
Normal file
8
.travis/post_failed.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
ZIPFILE=${HOME}/pokediamond.zip
|
||||
|
||||
build_name=${1:-pokediamond}
|
||||
zip -r ${ZIPFILE} ${TRAVIS_BUILD_DIR}
|
||||
ANONFILES_URL=$(curl -F "file=@$ZIPFILE" https://api.anonfiles.com/upload | grep -Po '"short": "\K[^"]*')
|
||||
curl -d "{\"username\": \"$CALCROM_DISCORD_WEBHOOK_USERNAME\", \"avatar_url\": \"$CALCROM_DISCORD_WEBHOOK_AVATAR_URL_NOTOK\", \"content\":\"ERROR IN $build_name\\nBranch: $TRAVIS_BRANCH\\nPull request: $TRAVIS_PULL_REQUEST\\nBuild state: $ANONFILES_URL\"}" -H "Content-Type: application/json" -X POST $CALCROM_DISCORD_WEBHOOK_URL
|
||||
Reference in New Issue
Block a user