mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-12 17:39:07 +08:00
add email and discord webhook
This commit is contained in:
parent
a9e931239f
commit
b714bf867b
10
.travis.yml
10
.travis.yml
@ -18,6 +18,7 @@ install:
|
|||||||
- pip install -U platformio
|
- pip install -U platformio
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
|
- export AUTHOR_NAME="$(git log -1 $TRAVIS_COMMIT --pretty="%aN")"
|
||||||
- platformio update
|
- platformio update
|
||||||
- wget http://downloads.arduino.cc/arduino-1.8.5-linux64.tar.xz
|
- wget http://downloads.arduino.cc/arduino-1.8.5-linux64.tar.xz
|
||||||
- tar xf arduino-1.8.5-linux64.tar.xz
|
- tar xf arduino-1.8.5-linux64.tar.xz
|
||||||
@ -70,8 +71,17 @@ script:
|
|||||||
- rm -fr $HOME/arduino_ide
|
- rm -fr $HOME/arduino_ide
|
||||||
- rm -fr $HOME/.arduino15
|
- rm -fr $HOME/.arduino15
|
||||||
- platformio run
|
- platformio run
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- chmod +x success.sh
|
||||||
|
- ./success.sh
|
||||||
|
after_failure:
|
||||||
|
- chmod +x fail.sh
|
||||||
|
- ./fail.sh
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
|
recipients:
|
||||||
|
- luc@tech-hunters.com
|
||||||
on_success: change
|
on_success: change
|
||||||
on_failure: change
|
on_failure: change
|
||||||
|
8
fail.sh
Normal file
8
fail.sh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
echo 'Sending Discord Webhook';
|
||||||
|
export BACKTICK='`';
|
||||||
|
export TIMESTAMP=$(date --utc +%FT%TZ);
|
||||||
|
export REPO_OWNER="luc-github";
|
||||||
|
export REPO_NAME="ESP3D";
|
||||||
|
export COMMIT_FORMATTED="[$BACKTICK${TRAVIS_COMMIT:0:7}$BACKTICK](https://github.com/$REPO_OWNER/$REPO_NAME/commit/$TRAVIS_COMMIT)";
|
||||||
|
curl -v -H User-Agent:bot -H Content-Type:application/json -d '{"avatar_url":"https://i.imgur.com/kOfUGNS.png","username":"Travis CI","embeds":[{"author":{"name":"Build #'"$TRAVIS_BUILD_NUMBER"' Failed - '"$AUTHOR_NAME"'","url":"https://travis-ci.org/'"$REPO_OWNER"'/'"$REPO_NAME"'/builds/'"$TRAVIS_BUILD_ID"'"},"url":"https://github.com/'"$REPO_OWNER"'/'"$REPO_NAME"'/commit/'"$TRAVIS_COMMIT"'","title":"['"$TRAVIS_REPO_SLUG"':'"$TRAVIS_BRANCH"'] ","color":16711680,"fields":[{"name":"_ _", "value": "'"$COMMIT_FORMATTED"' - '"$TRAVIS_COMMIT_MESSAGE"'"}],"timestamp":"'"$TIMESTAMP"'","footer":{"text":"Travis CI"}}]}' $DISCORD_WEBHOOK_URL;
|
8
success.sh
Normal file
8
success.sh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
echo 'Sending Discord Webhook';
|
||||||
|
export BACKTICK='`';
|
||||||
|
export TIMESTAMP=$(date --utc +%FT%TZ);
|
||||||
|
export REPO_OWNER="luc-github";
|
||||||
|
export REPO_NAME="ESP3D";
|
||||||
|
export COMMIT_FORMATTED="[$BACKTICK${TRAVIS_COMMIT:0:7}$BACKTICK](https://github.com/$REPO_OWNER/$REPO_NAME/commit/$TRAVIS_COMMIT)";
|
||||||
|
curl -v -H User-Agent:bot -H Content-Type:application/json -d '{"avatar_url":"https://i.imgur.com/kOfUGNS.png","username":"Travis CI","embeds":[{"author":{"name":"Build #'"$TRAVIS_BUILD_NUMBER"' Passed - '"$AUTHOR_NAME"'","url":"https://travis-ci.org/'"$REPO_OWNER"'/'"$REPO_NAME"'/builds/'"$TRAVIS_BUILD_ID"'"},"url":"https://github.com/'"$REPO_OWNER"'/'"$REPO_NAME"'/commit/'"$TRAVIS_COMMIT"'","title":"['"$TRAVIS_REPO_SLUG"':'"$TRAVIS_BRANCH"'] ","color":65280,"fields":[{"name":"_ _", "value": "'"$COMMIT_FORMATTED"' - '"$TRAVIS_COMMIT_MESSAGE"'"}],"timestamp":"'"$TIMESTAMP"'","footer":{"text":"Travis CI"}}]}' $DISCORD_WEBHOOK_URL;
|
Loading…
x
Reference in New Issue
Block a user