-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupload.sh
executable file
·36 lines (28 loc) · 915 Bytes
/
upload.sh
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
36
#!/usr/bin/env bash
set -e
function upload_via_ssh() {
[[ "${SRC}" == */ ]] && SRC="${SRC: : -1}" # remove trailing slash if there is one
# scp -r "$SRC/." "$USER@$HOST:/$DST"
rsync -ruL --delete --progress "$SRC/." "$USER@$HOST:$DST"
}
function upload_to_strato() {
SRC="$1"
echo "Uploading to Strato..."
USER=$(pass strato/flipsi | grep ssh-user | cut -f2 -d' ')
HOST=$(pass strato/flipsi | grep ssh-host | cut -f2 -d' ')
DST="www/standup"
upload_via_ssh
}
function prepare() {
TMP_DOC_ROOT="/tmp/standup"
mkdir -p "$TMP_DOC_ROOT"
cp "./src/main/resources/index-fullopt.html" "$TMP_DOC_ROOT/index.html"
cp "./src/main/resources/"*.css "$TMP_DOC_ROOT"
cp "./target/scala-2.13/scalajs-bundler/main/structured-standup-fastopt-bundle.js" "$TMP_DOC_ROOT"
echo "$TMP_DOC_ROOT"
}
function main() {
DIR=$(prepare)
upload_to_strato "$DIR"
}
main