Skip to content

Commit 033745c

Browse files
authored
SDK Upload Script (#7)
* Upload script to help deploying to our partners * You have to specify hosts individually * Small fix * Another small fix - tested + working --------- Co-authored-by: John Detter <[email protected]>
1 parent 6542084 commit 033745c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

upload.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
usage() {
6+
echo "Usage: upload.sh <ssh-key-file-path> <hostname>"
7+
}
8+
9+
if [ "$#" != 2 ] ; then
10+
usage
11+
exit 1
12+
fi
13+
14+
if [ ! -f "$1" ] ; then
15+
usage
16+
echo "File not found: $1"
17+
exit
18+
fi
19+
20+
echo "Make sure you have used \"export.sh\" to regenerate the SpacetimeDBUnitySDK."
21+
echo
22+
echo "We will be uploading this SDK to $2"
23+
echo "Your current branch is $(git rev-parse --abbrev-ref HEAD)"
24+
echo
25+
echo "If everything looks correct, press [Enter] now to continue."
26+
read -rp ""
27+
28+
scp -oStrictHostKeyChecking=no -i "$1" "SpacetimeDBUnitySDK.unitypackage" "root@${2}:/var/www/sdk/SpacetimeDBUnitySDK.unitypackage"
29+
ssh -oStrictHostKeyChecking=no -i "$1" "root@${2}" "chown -R jenkins:jenkins /var/www/sdk"
30+
echo "Upload success."

0 commit comments

Comments
 (0)