From c0828a891b61e543fc82b3e4c52d7463e112acdd Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 7 Feb 2018 17:28:04 +0000 Subject: [PATCH 1/2] Create manifest-prototype-2-base.yml --- Makefile | 5 +++++ manifest-prototype-2-base.yml | 31 +++++++++++++++++++++++++++++ manifest-prototype-2-preview.yml | 6 ++++++ manifest-prototype-2-production.yml | 6 ++++++ 4 files changed, 48 insertions(+) create mode 100644 manifest-prototype-2-base.yml create mode 100644 manifest-prototype-2-preview.yml create mode 100644 manifest-prototype-2-production.yml diff --git a/Makefile b/Makefile index 1aafc9d82..20d92d089 100644 --- a/Makefile +++ b/Makefile @@ -194,6 +194,11 @@ cf-deploy-prototype: cf-target ## Deploys the app to Cloud Foundry $(if ${CF_SPACE},,$(error Must specify CF_SPACE)) cf push -f <(make -s CF_MANIFEST_FILE=manifest-prototype-${CF_SPACE}.yml generate-manifest) +.PHONY: cf-deploy-prototype-2 +cf-deploy-prototype-2: cf-target ## Deploys the app to Cloud Foundry + $(if ${CF_SPACE},,$(error Must specify CF_SPACE)) + cf push -f <(make -s CF_MANIFEST_FILE=manifest-prototype-2-${CF_SPACE}.yml generate-manifest) + .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-2-base.yml b/manifest-prototype-2-base.yml new file mode 100644 index 000000000..e7927749e --- /dev/null +++ b/manifest-prototype-2-base.yml @@ -0,0 +1,31 @@ +--- + +buildpack: python_buildpack +command: scripts/run_app_paas.sh gunicorn -w 5 -b 0.0.0.0:$PORT application +instances: 1 +memory: 1G +env: + NOTIFY_APP_NAME: admin + + # Credentials variables + ADMIN_CLIENT_SECRET: null + ADMIN_BASE_URL: null + API_HOST_NAME: null + DANGEROUS_SALT: null + SECRET_KEY: null + ROUTE_SECRET_KEY_1: null + ROUTE_SECRET_KEY_2: null + + AWS_ACCESS_KEY_ID: null + AWS_SECRET_ACCESS_KEY: null + + STATSD_PREFIX: null + + DESKPRO_API_HOST: null + DESKPRO_API_KEY: null + + TEMPLATE_PREVIEW_API_HOST: null + TEMPLATE_PREVIEW_API_KEY: null + +applications: + - name: notify-admin-prototype-2 diff --git a/manifest-prototype-2-preview.yml b/manifest-prototype-2-preview.yml new file mode 100644 index 000000000..1a998d2d9 --- /dev/null +++ b/manifest-prototype-2-preview.yml @@ -0,0 +1,6 @@ +--- + +inherit: manifest-prototype-2-base.yml + +routes: + - route: notify-admin-prototype-2-preview.cloudapps.digital diff --git a/manifest-prototype-2-production.yml b/manifest-prototype-2-production.yml new file mode 100644 index 000000000..ffffa7686 --- /dev/null +++ b/manifest-prototype-2-production.yml @@ -0,0 +1,6 @@ +--- + +inherit: manifest-prototype-2-base.yml + +routes: + - route: notify-admin-prototype-2-production.cloudapps.digital From eaf1534e9a3522da60b09eedafea599c536a7412 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 9 Feb 2018 16:06:15 +0000 Subject: [PATCH 2/2] Write manifests to disk instead of redirecting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some time between version 6.32 and 6.34 of the Cloudfoundry CLI the ability to redirect the output of a command into `cf push -f` was broken. The only alternative we can think of is writing the file to disk, doing the deploy, and then deleting it. We’re careful to write to a directory outside the current repo to avoid: - including secrets in the deployed package - accidentally checking the secrets into source control `/tmp/` seems to be a good place to put it, since, even if the delete doesn’t run, it will get cleaned up eventually (probably when the machine next boots). Right now this only applies to people deploying from their local machines. At some point it will affect Jenkins too, but isn’t now. So this commit only fixes the problem for the commands that developers run locally. fixup! Write manifests to disk instead of redirecting --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 20d92d089..3aa1bcb14 100644 --- a/Makefile +++ b/Makefile @@ -192,12 +192,16 @@ cf-deploy: ## Deploys the app to Cloud Foundry .PHONY: cf-deploy-prototype cf-deploy-prototype: cf-target ## Deploys the app to Cloud Foundry $(if ${CF_SPACE},,$(error Must specify CF_SPACE)) - cf push -f <(make -s CF_MANIFEST_FILE=manifest-prototype-${CF_SPACE}.yml generate-manifest) + (make -s CF_MANIFEST_FILE=manifest-prototype-${CF_SPACE}.yml generate-manifest) > /tmp/admin_manifest.yml + cf push -f /tmp/admin_manifest.yml + rm /tmp/admin_manifest.yml .PHONY: cf-deploy-prototype-2 cf-deploy-prototype-2: cf-target ## Deploys the app to Cloud Foundry $(if ${CF_SPACE},,$(error Must specify CF_SPACE)) - cf push -f <(make -s CF_MANIFEST_FILE=manifest-prototype-2-${CF_SPACE}.yml generate-manifest) + (make -s CF_MANIFEST_FILE=manifest-prototype-2-${CF_SPACE}.yml generate-manifest) > /tmp/admin_manifest.yml + cf push -f /tmp/admin_manifest.yml + rm /tmp/admin_manifest.yml .PHONY: cf-rollback cf-rollback: ## Rollbacks the app to the previous release