diff options
-rwxr-xr-x | build_upload_nightly | 30 | ||||
-rwxr-xr-x | build_upload_win_nightly | 32 |
2 files changed, 61 insertions, 1 deletions
diff --git a/build_upload_nightly b/build_upload_nightly index aa52cb0..22a5d0f 100755 --- a/build_upload_nightly +++ b/build_upload_nightly @@ -14,6 +14,20 @@ result=$? if [ $result -ne 0 ]; then echo Build falied with return code $result stopping $CONTAINER_NAME lxc-stop -n "$CONTAINER_NAME" + curdate=`date -Iseconds` + curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF +{ + "embeds": [ + { + "title": "Build $name failed!", + "type": "rich", + "description": "Build falied with return code $result stopping $CONTAINER_NAME" + "timestamp": "$curdate", + "color": 16711680, + } + ] +} +WEBHOOKEOF exit $result fi echo "Build succeeded, stopping $CONTAINER_NAME" @@ -23,3 +37,19 @@ artifact=$(tail -n 1 /tmp/build_${name}_out.log) echo "Uploaing $artifact to $REMOTE_HOST" scp -i "$REMOTE_IDENT" "$HOME/.local/share/lxc/$CONTAINER_NAME/rootfs/home/$BUILD_USER/blastem/$artifact" $REMOTE_USER@$REMOTE_HOST:/home/$REMOTE_USER/nightlies echo "Done" +curdate=`date -Iseconds` +version=`echo "$artifact" | sed -E 's/[^-]+-([0-9]+\.[0-9]+\.[0-9]+[^.]*)\..*$/\1/'` +curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF +{ + "embeds": [ + { + "title": "New build of $name succeeded!", + "type": "rich", + "url": "https://www.retrodev.com/blastem/nightlies/$artifact" + "description": "Version: $version" + "timestamp": "$curdate", + "color": 65280, + } + ] +} +WEBHOOKEOF
\ No newline at end of file diff --git a/build_upload_win_nightly b/build_upload_win_nightly index 9c6cce1..1edc00b 100755 --- a/build_upload_win_nightly +++ b/build_upload_win_nightly @@ -1,6 +1,6 @@ #!/bin/sh name=$1 - +. "$HOME/$name.params" cd $HOME/blastem_win hg revert -a hg pull @@ -12,9 +12,39 @@ export OS=Windows result=$? if [ $result -ne 0 ]; then echo Build falied with return code $result + curdate=`date -Iseconds` + curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF +{ + "embeds": [ + { + "title": "Build $name failed!", + "type": "rich", + "description": "Build falied with return code $result" + "timestamp": "$curdate", + "color": 16711680, + } + ] +} +WEBHOOKEOF exit $result fi . $HOME/remote.params artifact=$(tail -n 1 /tmp/build_${name}_out.log) echo "Uploaing $artifact to $REMOTE_HOST" scp -i "$REMOTE_IDENT" "$HOME/blastem_win/$artifact" $REMOTE_USER@$REMOTE_HOST:/home/$REMOTE_USER/nightlies +curdate=`date -Iseconds` +version=`echo "$artifact" | sed -E 's/[^-]+-([0-9]+\.[0-9]+\.[0-9]+[^.]*)\..*$/\1/'` +curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF +{ + "embeds": [ + { + "title": "New build of $name succeeded!", + "type": "rich", + "url": "https://www.retrodev.com/blastem/nightlies/$artifact" + "description": "Version: $version" + "timestamp": "$curdate", + "color": 65280, + } + ] +} +WEBHOOKEOF
\ No newline at end of file |