comparison build_upload_nightly @ 1842:49f65d240299 mame_interp

Merge from default
author Michael Pavone <pavone@retrodev.com>
date Sun, 14 Apr 2019 23:38:02 -0700
parents 2efdace4fb8a
children
comparison
equal deleted inserted replaced
1787:0c6d07f91346 1842:49f65d240299
12 lxc-attach -n "$CONTAINER_NAME" -- /home/$BUILD_USER/blastem/build_nightly $BUILD_USER needsu 2>&1 > /tmp/build_${name}_out.log 12 lxc-attach -n "$CONTAINER_NAME" -- /home/$BUILD_USER/blastem/build_nightly $BUILD_USER needsu 2>&1 > /tmp/build_${name}_out.log
13 result=$? 13 result=$?
14 if [ $result -ne 0 ]; then 14 if [ $result -ne 0 ]; then
15 echo Build falied with return code $result stopping $CONTAINER_NAME 15 echo Build falied with return code $result stopping $CONTAINER_NAME
16 lxc-stop -n "$CONTAINER_NAME" 16 lxc-stop -n "$CONTAINER_NAME"
17 curdate=`date -Iseconds`
18 curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF
19 {
20 "embeds": [
21 {
22 "title": "Build $name failed!",
23 "type": "rich",
24 "description": "Build falied with return code $result stopping $CONTAINER_NAME",
25 "timestamp": "$curdate",
26 "color": 16711680
27 }
28 ]
29 }
30 WEBHOOKEOF
17 exit $result 31 exit $result
18 fi 32 fi
19 echo "Build succeeded, stopping $CONTAINER_NAME" 33 echo "Build succeeded, stopping $CONTAINER_NAME"
20 lxc-stop -n "$CONTAINER_NAME" 34 lxc-stop -n "$CONTAINER_NAME"
21 . $HOME/remote.params 35 . $HOME/remote.params
22 artifact=$(tail -n 1 /tmp/build_${name}_out.log) 36 artifact=$(tail -n 1 /tmp/build_${name}_out.log)
23 echo "Uploaing $artifact to $REMOTE_HOST" 37 echo "Uploaing $artifact to $REMOTE_HOST"
24 scp -i "$REMOTE_IDENT" "$HOME/.local/share/lxc/$CONTAINER_NAME/rootfs/home/$BUILD_USER/blastem/$artifact" $REMOTE_USER@$REMOTE_HOST:/home/$REMOTE_USER/nightlies 38 scp -i "$REMOTE_IDENT" "$HOME/.local/share/lxc/$CONTAINER_NAME/rootfs/home/$BUILD_USER/blastem/$artifact" $REMOTE_USER@$REMOTE_HOST:/home/$REMOTE_USER/nightlies
25 echo "Done" 39 echo "Done"
40 curdate=`date -Iseconds`
41 version=`echo "$artifact" | sed -E 's/[^-]+-([0-9]+\.[0-9]+\.[0-9]+[^.]*)\..*$/\1/'`
42 curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF
43 {
44 "embeds": [
45 {
46 "title": "$artifact",
47 "type": "rich",
48 "url": "https://www.retrodev.com/blastem/nightlies/$artifact",
49 "description": "New build of $name succeeded!",
50 "timestamp": "$curdate",
51 "color": 65280,
52 "fields": [
53 {
54 "name": "Version",
55 "value": "$version"
56 }
57 ]
58 }
59 ]
60 }
61 WEBHOOKEOF