File: trigger_deploy.sh

package info (click to toggle)
electrum 4.7.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,528 kB
  • sloc: python: 109,677; sh: 1,487; java: 335; xml: 51; makefile: 33
file content (35 lines) | stat: -rwxr-xr-x 915 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Triggers deploy.sh to maybe update the website or move binaries.
# uploadserver needs to be defined in /etc/hosts

SSHUSER=$1
TRIGGERVERSION=$2
if [ -z "$SSHUSER" ] || [ -z "$TRIGGERVERSION" ]; then
    echo "usage: $0 SSHUSER TRIGGERVERSION"
    echo "e.g. $0 thomasv 3.0.0"
    echo "e.g. $0 thomasv website"
    exit 1
fi
set -ex
cd "$(dirname "$0")"

if [ "$TRIGGERVERSION" == "website" ]; then
    rm -f trigger_website
    touch trigger_website
    echo "uploading file: trigger_website..."
    sftp -oBatchMode=no -b - "$SSHUSER@uploadserver" << !
       cd electrum-downloads-airlock
       mput trigger_website
       bye
!
else
    rm -f trigger_binaries
    printf "$TRIGGERVERSION" > trigger_binaries
    echo "uploading file: trigger_binaries..."
    sftp -oBatchMode=no -b - "$SSHUSER@uploadserver" << !
       cd electrum-downloads-airlock
       mput trigger_binaries
       bye
!
fi