Manual install of cobudget-api
Introduction
The server will be set up to use blue/green deployments. This will done by making two directories, incidentally named blue
and green
and set a symbolic link current
that points to the current release in production.
A new release can then be prepared in the directory not currently in use and the change can happen almost instantanously.
Rollback to the previous version can happen equally fast (if there are no incompatible database changes).
First time install
Create directories, adjust permissions and clone the cobudget-api
github repo.
Get the env
and start
files and copy to the installed dir
git clone https://github.com/greaterthan/aws-deploy.git
Now edit the env
and env-vars
file. The database variable could be
Install missing Postgresql dev files and install all packages
Brief notes on new deployment
Remove the unused blue of green dir
Clone the api repo into the unused blue or green dir
Copy
env
,env-vars
,start
andconfig/database.yml
to the new dir
If there's a DB update, dumb the DB before the update, do the update and dump it again after. Just to be sure.
And finally, change the symlink and restart the service
Running with systemd
Copy the systemd config files
Get systemd to read the file, start the server and enable for automatic start at boot
You can check if the server has started with
Last updated