How to deploy:

1. Take one ec2 server out of the load balancer and wait 30 seconds until all connections have been drained. (you can check the current log to see when the last request was). The load balancer can be found here https://us-west-2.console.aws.amazon.com/ec2/v2/home?region=us-west-2#LoadBalancers:search=leviathan-prod
2. Login to that ec2 server, LDAP doesn't work so you have to use the key pair that's linked to the instance
3. cd /var/leviathan
4. sudo su leviathan
5. script /dev/null
6. screen -r rails
7. CRTL + C (to stop rails)
8. Upload new code to the server via WinSCP or another file transferring tool using ssh
9. Run compile_assets.sh to compile all css / js ... files (if you made any changes to these files with this deploy, else you can skip this step)
10. Start rails again via start_rails.sh
11. CRTL + A + D (to close the screen window)
12. Insert server into load balancer again
13. Do step 1 again if there are multiple servers but wait a short time after adding a server until it's actually serving traffic so we don't have a situation where no server is ready in the load balancer config


Some more info:
The servers don't run Twitch AMIs so your LDAP login won't work
The installation path is /var/leviathan
The chatlogger and the Slack schedule script only run on leviathan-prod-1
Rails logs are located in /var/leviathan/log
Nginx logs are located in /var/log/nginx (you want to look for access_leviathan-ssl.log)
