Add config to deploy a prototype version of admin

Sometimes we want to make changes to the admin app for doing user
research that we don’t want all users to see (because we’re not sure if
they’re the right changes to be making).

Previously this meant doing the research using a team member’s computer,
with the app running locally. This was bad for three reasons:

- requires the time of someone who has the code running locally
- requires the participant to use an unfamiliar computer
- means the participant doesn’t have access to their own Notify account
  (or an account that we’ve set up for doing user research with)

The dream* would be to have two versions of the frontend app running
side by side in production. This commit makes the dream real – the two
versions of admin are:

- the normal admin app, accessible on
  `www.notifications.service.gov.uk`
- a prototype version meant to be pushed to from a developer’s local
  machine**, on a `cloudapps.digital` subdomain

Both of these apps share the same backing services, eg config, API
instance, queues, etc, etc. Which means that the prototype version can
be logged into with the same username and password, and the user will
see their service and all their templates when they do so.

Ideally this wouldn’t mean creating a separate base manifest. However
it’s a feature of Cloud Foundry that you can override the application
name. Which means a separate base manifest and a bit of duplication. 😞

* actually the real dream would be to have a version of admin deployed
for each branch of the admin app, but this might get a bit resource
intensive.

** by running `CF_SPACE=preview make preview cf-deploy-prototype`, where
`preview` is the name of the space you want to deploy to
This commit is contained in:
Chris Hill-Scott
2017-05-05 08:41:55 +01:00
parent 3829002d65
commit 4fc98127ca
5 changed files with 41 additions and 0 deletions

View File

@@ -219,6 +219,12 @@ cf-deploy: ## Deploys the app to Cloud Foundry
cf stop notify-admin-rollback
cf delete -f notify-admin-rollback
.PHONY: cf-deploy-prototype
cf-deploy-prototype: ## Deploys the app to Cloud Foundry
$(if ${CF_SPACE},,$(error Must specify CF_SPACE))
cf target -s ${CF_SPACE}
cf push -f manifest-prototype-${CF_SPACE}.yml
.PHONY: cf-rollback
cf-rollback: ## Rollbacks the app to the previous release
@cf app --guid notify-admin-rollback || exit 1

View File

@@ -0,0 +1,17 @@
---
buildpack: python_buildpack
command: scripts/run_app_paas.sh gunicorn -w 5 -b 0.0.0.0:$PORT wsgi
services:
- notify-aws
- notify-config
- notify-template-preview
- hosted-graphite
- deskpro
instances: 1
memory: 1G
env:
NOTIFY_APP_NAME: admin
applications:
- name: notify-admin-prototype

View File

@@ -0,0 +1,6 @@
---
inherit: manifest-prototype-base.yml
routes:
- route: notify-admin-prototype-preview.cloudapps.digital

View File

@@ -0,0 +1,6 @@
---
inherit: manifest-prototype-base.yml
routes:
- route: notify-admin-prototype-production.cloudapps.digital

View File

@@ -0,0 +1,6 @@
---
inherit: manifest-prototype-base.yml
routes:
- route: notify-admin-prototype-staging.cloudapps.digital