Last active
September 22, 2022 20:42
-
-
Save felipeggrod/3c9e0b6addabccdc959c7e4c9e3bade0 to your computer and use it in GitHub Desktop.
Automate Game/App Server Deployment scripts to Google Cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sh .\uploadServerApp.sh | |
sh .\restartServer.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plink (USER)@(SERVER_IP) -i (PRIVATE_KEY).ppk -m deploy_cmds.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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