Mercurial > repos > blastem
annotate build_upload_win_nightly @ 1836:601ef72cc16f
Fix upload path to take into account separate Win64 directory
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 09 Apr 2019 22:48:06 -0700 |
parents | b58310808b10 |
children |
rev | line source |
---|---|
1240
c63516b6824a
Fun untested changes for uploading nightly builds
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #!/bin/sh |
c63516b6824a
Fun untested changes for uploading nightly builds
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 name=$1 |
1800
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
3 . "$HOME/$name.params" |
1833
b58310808b10
Use separate directories for Win32 and Win64 nightly builds
Michael Pavone <pavone@retrodev.com>
parents:
1832
diff
changeset
|
4 cd $HOME/$DIR |
1248
d4ae118cf41d
build_upload_win_nightly needs some steps from build_nightly since it skips invoking that script and instead calls build_release directly
Michael Pavone <pavone@retrodev.com>
parents:
1246
diff
changeset
|
5 hg revert -a |
1246
8e911c57846c
Windows nightly build upload script
Michael Pavone <pavone@retrodev.com>
parents:
1243
diff
changeset
|
6 hg pull |
8e911c57846c
Windows nightly build upload script
Michael Pavone <pavone@retrodev.com>
parents:
1243
diff
changeset
|
7 hg up |
1248
d4ae118cf41d
build_upload_win_nightly needs some steps from build_nightly since it skips invoking that script and instead calls build_release directly
Michael Pavone <pavone@retrodev.com>
parents:
1246
diff
changeset
|
8 rev=`hg summary | sed -E -n 's/^parent: [^:]+:([^ ]+) .*$/\1/p'` |
d4ae118cf41d
build_upload_win_nightly needs some steps from build_nightly since it skips invoking that script and instead calls build_release directly
Michael Pavone <pavone@retrodev.com>
parents:
1246
diff
changeset
|
9 sed -i -E "s/(define BLASTEM_VERSION \"[^-]+)-pre\"/\1-pre-$rev\"/" blastem.c |
1832
b35743f28744
Get OS param from config file for win nightly build/upload script
Michael Pavone <pavone@retrodev.com>
parents:
1801
diff
changeset
|
10 export OS |
1246
8e911c57846c
Windows nightly build upload script
Michael Pavone <pavone@retrodev.com>
parents:
1243
diff
changeset
|
11 ./build_release > /tmp/build_${name}_out.log |
1251
f249fd91b0f5
More logging. Fix path in upload step of build_upload_win_nightly
Michael Pavone <pavone@retrodev.com>
parents:
1248
diff
changeset
|
12 result=$? |
f249fd91b0f5
More logging. Fix path in upload step of build_upload_win_nightly
Michael Pavone <pavone@retrodev.com>
parents:
1248
diff
changeset
|
13 if [ $result -ne 0 ]; then |
f249fd91b0f5
More logging. Fix path in upload step of build_upload_win_nightly
Michael Pavone <pavone@retrodev.com>
parents:
1248
diff
changeset
|
14 echo Build falied with return code $result |
1800
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
15 curdate=`date -Iseconds` |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
16 curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
17 { |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
18 "embeds": [ |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
19 { |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
20 "title": "Build $name failed!", |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
21 "type": "rich", |
1801
2efdace4fb8a
Fix and update JSON payload for webhook in build scripts
Michael Pavone <pavone@retrodev.com>
parents:
1800
diff
changeset
|
22 "description": "Build falied with return code $result", |
1800
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
23 "timestamp": "$curdate", |
1801
2efdace4fb8a
Fix and update JSON payload for webhook in build scripts
Michael Pavone <pavone@retrodev.com>
parents:
1800
diff
changeset
|
24 "color": 16711680 |
1800
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
25 } |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
26 ] |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
27 } |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
28 WEBHOOKEOF |
1251
f249fd91b0f5
More logging. Fix path in upload step of build_upload_win_nightly
Michael Pavone <pavone@retrodev.com>
parents:
1248
diff
changeset
|
29 exit $result |
f249fd91b0f5
More logging. Fix path in upload step of build_upload_win_nightly
Michael Pavone <pavone@retrodev.com>
parents:
1248
diff
changeset
|
30 fi |
1241
23a2cf9782a7
Fixes for nightly build upload script
Michael Pavone <pavone@retrodev.com>
parents:
1240
diff
changeset
|
31 . $HOME/remote.params |
1240
c63516b6824a
Fun untested changes for uploading nightly builds
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
32 artifact=$(tail -n 1 /tmp/build_${name}_out.log) |
1251
f249fd91b0f5
More logging. Fix path in upload step of build_upload_win_nightly
Michael Pavone <pavone@retrodev.com>
parents:
1248
diff
changeset
|
33 echo "Uploaing $artifact to $REMOTE_HOST" |
1836
601ef72cc16f
Fix upload path to take into account separate Win64 directory
Michael Pavone <pavone@retrodev.com>
parents:
1833
diff
changeset
|
34 scp -i "$REMOTE_IDENT" "$HOME/$DIR/$artifact" $REMOTE_USER@$REMOTE_HOST:/home/$REMOTE_USER/nightlies |
1800
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
35 curdate=`date -Iseconds` |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
36 version=`echo "$artifact" | sed -E 's/[^-]+-([0-9]+\.[0-9]+\.[0-9]+[^.]*)\..*$/\1/'` |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
37 curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
38 { |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
39 "embeds": [ |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
40 { |
1801
2efdace4fb8a
Fix and update JSON payload for webhook in build scripts
Michael Pavone <pavone@retrodev.com>
parents:
1800
diff
changeset
|
41 "title": "$artifact", |
1800
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
42 "type": "rich", |
1801
2efdace4fb8a
Fix and update JSON payload for webhook in build scripts
Michael Pavone <pavone@retrodev.com>
parents:
1800
diff
changeset
|
43 "url": "https://www.retrodev.com/blastem/nightlies/$artifact", |
2efdace4fb8a
Fix and update JSON payload for webhook in build scripts
Michael Pavone <pavone@retrodev.com>
parents:
1800
diff
changeset
|
44 "description": "New build of $name succeeded!", |
1800
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
45 "timestamp": "$curdate", |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
46 "color": 65280, |
1801
2efdace4fb8a
Fix and update JSON payload for webhook in build scripts
Michael Pavone <pavone@retrodev.com>
parents:
1800
diff
changeset
|
47 "fields": [ |
2efdace4fb8a
Fix and update JSON payload for webhook in build scripts
Michael Pavone <pavone@retrodev.com>
parents:
1800
diff
changeset
|
48 { |
2efdace4fb8a
Fix and update JSON payload for webhook in build scripts
Michael Pavone <pavone@retrodev.com>
parents:
1800
diff
changeset
|
49 "name": "Version", |
2efdace4fb8a
Fix and update JSON payload for webhook in build scripts
Michael Pavone <pavone@retrodev.com>
parents:
1800
diff
changeset
|
50 "value": "$version" |
2efdace4fb8a
Fix and update JSON payload for webhook in build scripts
Michael Pavone <pavone@retrodev.com>
parents:
1800
diff
changeset
|
51 } |
2efdace4fb8a
Fix and update JSON payload for webhook in build scripts
Michael Pavone <pavone@retrodev.com>
parents:
1800
diff
changeset
|
52 ] |
1800
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
53 } |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
54 ] |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
55 } |
0d942ecf38c5
Post build results to discord via webhook
Michael Pavone <pavone@retrodev.com>
parents:
1251
diff
changeset
|
56 WEBHOOKEOF |