Skip to content

Instantly share code, notes, and snippets.

@felipeggrod
Last active September 22, 2022 20:42
Show Gist options
  • Save felipeggrod/3c9e0b6addabccdc959c7e4c9e3bade0 to your computer and use it in GitHub Desktop.
Save felipeggrod/3c9e0b6addabccdc959c7e4c9e3bade0 to your computer and use it in GitHub Desktop.
Automate Game/App Server Deployment scripts to Google Cloud
sh .\uploadServerApp.sh
sh .\restartServer.sh
echo "************ Restarting Server Persistent Process"
echo "************ Adding permissions"
chmod +rwx LinuxServer/Server.exe
echo $'************ Killing all Server.exe (Previously running servers)'
killall Server.exe
killall screen
echo $'************ Initiating screen (multiplexer to run our server process without attaching to this terminal session, make the server keep running after we close ssh.)'
screen -m -d ./LinuxServer/Server.exe
screen -list
echo $'\n\n\n************ DEPLOY FINISHED **********\n\n\n'
sleep 30
These are some scripts to help with deployment of development servers for an application/game on a Linux VPS on Google Cloud.
You'll need to have putty(plink) installed and generate an .ppk for your VPS instance.
Useful server cli commands:
'top' displays processes with cpu usage %
'screen -ls' list active screens (server processes running)
'screen -r -d' reattach to the first screen running, detach it from any other attachment OR 'screen -r <process-id | screen name>'
Detach from Linux Screen Session: Ctrl + A + D
This gist complements this guide: https://miragenet.github.io/Mirage/docs/guides/development-servers/google-cloud
plink (USER)@(SERVER_IP) -i (PRIVATE_KEY).ppk -m deploy_cmds.txt
pscp -r -i (PRIVATE_KEY).ppk (SERVER_FOLDER e.g. /LinuxServer) (USER)@(SERVER_IP):/home/(USER)
sleep 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment