| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # Triggers deploy.sh to maybe update the website or move binaries. |
| 3 | # uploadserver needs to be defined in /etc/hosts |
| 4 | |
| 5 | SSHUSER=$1 |
| 6 | TRIGGERVERSION=$2 |
| 7 | if [scip-shell system . . `[`. -z "$SSHUSER" ] || [scip-shell system . . `[`. -z "$TRIGGERVERSION" ]; then |
| 8 | echoscip-shell system . . echo. "usage: $0 SSHUSER TRIGGERVERSION" |
| 9 | echoscip-shell system . . echo. "e.g. $0 thomasv 3.0.0" |
| 10 | echoscip-shell system . . echo. "e.g. $0 thomasv website" |
| 11 | exit 1 |
| 12 | fi |
| 13 | set -ex |
| 14 | cd "$(dirnamescip-shell system . . dirname. "$0")" |
| 15 | |
| 16 | if [scip-shell system . . `[`. "$TRIGGERVERSION" == "website" ]; then |
| 17 | rmscip-shell system . . rm. -f trigger_website |
| 18 | touchscip-shell system . . touch. trigger_website |
| 19 | echoscip-shell system . . echo. "uploading file: trigger_website..." |
| 20 | sftpscip-shell system . . sftp. -oBatchMode=no -b - "$SSHUSER@uploadserver" << ! |
| 21 | cd electrum-downloads-airlock |
| 22 | mput trigger_website |
| 23 | bye |
| 24 | ! |
| 25 | else |
| 26 | rmscip-shell system . . rm. -f trigger_binaries |
| 27 | printfscip-shell system . . printf. "$TRIGGERVERSION" > trigger_binaries |
| 28 | echoscip-shell system . . echo. "uploading file: trigger_binaries..." |
| 29 | sftpscip-shell system . . sftp. -oBatchMode=no -b - "$SSHUSER@uploadserver" << ! |
| 30 | cd electrum-downloads-airlock |
| 31 | mput trigger_binaries |
| 32 | bye |
| 33 | ! |
| 34 | fi |
| 35 |