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 <no-reply@boppygames.gg>
This commit is contained in:
John Detter
2023-02-27 18:16:48 -06:00
committed by GitHub
parent 6542084b8a
commit 033745c2a9
Executable
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
set -euo pipefail
usage() {
echo "Usage: upload.sh <ssh-key-file-path> <hostname>"
}
if [ "$#" != 2 ] ; then
usage
exit 1
fi
if [ ! -f "$1" ] ; then
usage
echo "File not found: $1"
exit
fi
echo "Make sure you have used \"export.sh\" to regenerate the SpacetimeDBUnitySDK."
echo
echo "We will be uploading this SDK to $2"
echo "Your current branch is $(git rev-parse --abbrev-ref HEAD)"
echo
echo "If everything looks correct, press [Enter] now to continue."
read -rp ""
scp -oStrictHostKeyChecking=no -i "$1" "SpacetimeDBUnitySDK.unitypackage" "root@${2}:/var/www/sdk/SpacetimeDBUnitySDK.unitypackage"
ssh -oStrictHostKeyChecking=no -i "$1" "root@${2}" "chown -R jenkins:jenkins /var/www/sdk"
echo "Upload success."