From 4fc98127cae6f1becb2696cc27d2066801543995 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 5 May 2017 08:41:55 +0100 Subject: [PATCH] Add config to deploy a prototype version of admin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Makefile | 6 ++++++ manifest-prototype-base.yml | 17 +++++++++++++++++ manifest-prototype-preview.yml | 6 ++++++ manifest-prototype-production.yml | 6 ++++++ manifest-prototype-staging.yml | 6 ++++++ 5 files changed, 41 insertions(+) create mode 100644 manifest-prototype-base.yml create mode 100644 manifest-prototype-preview.yml create mode 100644 manifest-prototype-production.yml create mode 100644 manifest-prototype-staging.yml diff --git a/Makefile b/Makefile index e5e23a368..56200d921 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/manifest-prototype-base.yml b/manifest-prototype-base.yml new file mode 100644 index 000000000..0cd3aac50 --- /dev/null +++ b/manifest-prototype-base.yml @@ -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 diff --git a/manifest-prototype-preview.yml b/manifest-prototype-preview.yml new file mode 100644 index 000000000..140d17a98 --- /dev/null +++ b/manifest-prototype-preview.yml @@ -0,0 +1,6 @@ +--- + +inherit: manifest-prototype-base.yml + +routes: + - route: notify-admin-prototype-preview.cloudapps.digital diff --git a/manifest-prototype-production.yml b/manifest-prototype-production.yml new file mode 100644 index 000000000..4fc239945 --- /dev/null +++ b/manifest-prototype-production.yml @@ -0,0 +1,6 @@ +--- + +inherit: manifest-prototype-base.yml + +routes: + - route: notify-admin-prototype-production.cloudapps.digital diff --git a/manifest-prototype-staging.yml b/manifest-prototype-staging.yml new file mode 100644 index 000000000..0c840b43f --- /dev/null +++ b/manifest-prototype-staging.yml @@ -0,0 +1,6 @@ +--- + +inherit: manifest-prototype-base.yml + +routes: + - route: notify-admin-prototype-staging.cloudapps.digital