Deployment - HelpRefugees/project-flamingo GitHub Wiki
Project Flamingo is relatively straightforward to deploy to Cloud Foundry, this is performed automatically by the Travis build (normal commits are deployed to an acceptance space, tagged commits are deployed to a production space).
However, there are a few things you need to set up when deploying to a new space:
-
Create a MongoDB service in the space your app will be deployed and name it
flamongo-db
(we're using mLab on Pivotal Web Services). Alter -
Set the
SESSION_SECRET
environment variable, which is used as thesecret
parameter forexpress-session
. You should make this a random string, e.g. using:python -c "import random; print format(random.randrange(16**30), '030x')"
-
Set the
EMAIL_WEBHOOK
environment variable, which is used to dispatch notifications (see Notifications). -
Organise for the
generate-reports
script to be run at least monthly, to generate the new reporting period's reports (we're using Scheduler for PCF to run the taskyarn generate-reports
at 5am on the 1st of every month with the cron pattern0 5 1 * ?
). -
Organise for the
send-due-emails
script to be run on the third of each month, to remind implementing partners to submit their reports (we're using Scheduler for PCF to run the taskyarn send-due-emails
at 5am on the 3rd of every month with the cron pattern0 5 3 * ?
).
Production Release
The easiest way to cut a release is to use
yarn version
, which will
update the version in the package.json
and create and tag an appropriate
commit.
Administration Panel
While we don't have much in the way of administrative features in the app
itself, you can install an admin panel in Cloud Foundry to make updating the
database more straightforward. We've created
a fork of mongo-express
with
an updated manifest file and added a deploy script that you can use as follows:
./deploy.sh <admin-username> <admin-password>
You need to install the CF CLI for this script to work, and to log in to the appropriate Cloud Foundry foundation and target the correct org and space for your app.
The deploy script will pick a random route for the admin panel, to avoid conflicts with other, similarly-named apps.