mirror of
https://github.com/swarm-game/swarm.git
synced 2024-09-11 14:46:33 +03:00
This is a rework of #1798 to facilitate a simpler web stack. # Demo View http://swarmgame.net/ NOTE: Requires IPv6 # Motivation Hosting cost is a main motivation. Cost per month for an EC2 instance, RDS, and the requisite other services approaches >$50 per month. In contrast, the lowest-tier Lightsail instance is $3.50/month. The deployment process is of course simplified. An incidental benefit to using SQLite is reduced latency of web requests; we no longer need to fetch credentials from an AWS API to connect to Postgres. ## Changes Major changes: * Use `sqlite` instead of `postgres` * Use Docker to build a statically-linked deployable binary, rather than deploying the app within a Docker image Fortunately, the API of `sqlite-simple` is near-identical to that of `postgresql-simple`, so most of the code change there is just to rip out AWS-specific stuff and Postgres connection info. I have no hesitation to delete this code since if we ever want to use the previous stack again, we can just look at #1798.
18 lines
426 B
Bash
Executable File
18 lines
426 B
Bash
Executable File
#!/bin/bash -ex
|
|
|
|
cd $(git rev-parse --show-toplevel)
|
|
|
|
tournament/scripts/docker/build-static-binary.sh
|
|
|
|
INTERNAL_BINARY_NAME=tournament-bin
|
|
scp -r $INTERNAL_BINARY_NAME lightsail:
|
|
|
|
rm $INTERNAL_BINARY_NAME
|
|
|
|
CURRENT_GIT_HASH_FILEPATH=git-hash.txt
|
|
git rev-parse HEAD > $CURRENT_GIT_HASH_FILEPATH
|
|
scp $CURRENT_GIT_HASH_FILEPATH lightsail:
|
|
rm $CURRENT_GIT_HASH_FILEPATH
|
|
|
|
ssh lightsail -C 'sudo systemctl restart swarm-tournament'
|