comparison build_upload_win_nightly @ 1801:2efdace4fb8a

Fix and update JSON payload for webhook in build scripts
author Michael Pavone <pavone@retrodev.com>
date Mon, 25 Mar 2019 23:34:52 -0700
parents 0d942ecf38c5
children b35743f28744
comparison
equal deleted inserted replaced
1800:0d942ecf38c5 1801:2efdace4fb8a
17 { 17 {
18 "embeds": [ 18 "embeds": [
19 { 19 {
20 "title": "Build $name failed!", 20 "title": "Build $name failed!",
21 "type": "rich", 21 "type": "rich",
22 "description": "Build falied with return code $result" 22 "description": "Build falied with return code $result",
23 "timestamp": "$curdate", 23 "timestamp": "$curdate",
24 "color": 16711680, 24 "color": 16711680
25 } 25 }
26 ] 26 ]
27 } 27 }
28 WEBHOOKEOF 28 WEBHOOKEOF
29 exit $result 29 exit $result
36 version=`echo "$artifact" | sed -E 's/[^-]+-([0-9]+\.[0-9]+\.[0-9]+[^.]*)\..*$/\1/'` 36 version=`echo "$artifact" | sed -E 's/[^-]+-([0-9]+\.[0-9]+\.[0-9]+[^.]*)\..*$/\1/'`
37 curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF 37 curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF
38 { 38 {
39 "embeds": [ 39 "embeds": [
40 { 40 {
41 "title": "New build of $name succeeded!", 41 "title": "$artifact",
42 "type": "rich", 42 "type": "rich",
43 "url": "https://www.retrodev.com/blastem/nightlies/$artifact" 43 "url": "https://www.retrodev.com/blastem/nightlies/$artifact",
44 "description": "Version: $version" 44 "description": "New build of $name succeeded!",
45 "timestamp": "$curdate", 45 "timestamp": "$curdate",
46 "color": 65280, 46 "color": 65280,
47 "fields": [
48 {
49 "name": "Version",
50 "value": "$version"
51 }
52 ]
47 } 53 }
48 ] 54 ]
49 } 55 }
50 WEBHOOKEOF 56 WEBHOOKEOF