Debian Codegraph @

contrib/upload.sh

raw symbols SCIP
1 #!/bin/bash
2 # uploadserver is set in /etc/hosts
3 #
4 # env vars:
5 # - ELECBUILD_UPLOADFROM
6 # - SSHUSER
7
8 set -ex
9
10 PROJECT_ROOT="$(dirname "$(readlink -e "$0")")/.."
11 CONTRIB="$PROJECT_ROOT/contrib"
12
13 if [ -z "$SSHUSER" ]; then
14 SSHUSER=thomasv
15 fi
16
17 cd "$PROJECT_ROOT"
18
19 VERSION=$("$CONTRIB"/print_electrum_version.py)
20 echo "$VERSION"
21
22 if [ -z "$ELECBUILD_UPLOADFROM" ]; then
23 cd "$PROJECT_ROOT/dist"
24 else
25 cd "$ELECBUILD_UPLOADFROM"
26 fi
27
28
29 # do not fail sftp if directory exists
30 # see https://stackoverflow.com/questions/51437924/bash-shell-sftp-check-if-directory-exists-before-creating
31
32 sftp -oBatchMode=no -b - "$SSHUSER@uploadserver" << !
33 cd electrum-downloads-airlock
34 -mkdir "$VERSION"
35 -chmod 777 "$VERSION"
36 cd "$VERSION"
37 -mput *
38 -chmod 444 * # this prevents future re-uploads of same file
39 bye
40 !
41
42 "$CONTRIB/trigger_deploy.sh" "$SSHUSER" "$VERSION"