This repository has been archived by the owner on Nov 27, 2020. It is now read-only.
/
deploy-to-govuk-paas.yml
67 lines (64 loc) · 2.84 KB
/
deploy-to-govuk-paas.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
platform: linux
image_resource:
type: docker-image
source:
repository: governmentpaas/cf-cli
tag: latest
inputs:
- name: git-master
path: src
params:
CF_API: https://api.cloud.service.gov.uk
CF_USERNAME: ((paas-username))
CF_PASSWORD: ((paas-password))
CF_ORG: govuk_development
SENTRY_DSN: https://((sentry-dsn))
SECRET_KEY_BASE:
CF_STARTUP_TIMEOUT:
CF_SPACE:
HOSTNAME:
INSTANCES:
WORKER_INSTANCES:
BASIC_AUTH_PASSWORD:
GA_VIEW_ID: UA-43115970-1
GA_CROSS_DOMAIN_ID: UA-145652997-1
AWS_ACCESS_KEY_ID:
AWS_SECRET_ACCESS_KEY:
AWS_ERROR_PAGES_BUCKET_NAME:
AWS_REGION: eu-west-2
GOVUK_NOTIFY_TEMPLATE_ID:
NOTIFY_API_KEY:
run:
dir: src
path: sh
args:
- '-c'
- |
set -eu
cf api "$CF_API"
cf auth
cf t -o "$CF_ORG" -s "$CF_SPACE"
cf create-app govuk-coronavirus-business-volunteer-form || true
cf apply-manifest -f manifest.yml
cf set-env govuk-coronavirus-business-volunteer-form CF_STARTUP_TIMEOUT "$CF_STARTUP_TIMEOUT"
cf scale --process web -i "$INSTANCES" govuk-coronavirus-business-volunteer-form
cf scale --process worker -i "$WORKER_INSTANCES" govuk-coronavirus-business-volunteer-form
cf set-env govuk-coronavirus-business-volunteer-form AWS_ASSETS_BUCKET_NAME "$AWS_ASSETS_BUCKET_NAME"
cf set-env govuk-coronavirus-business-volunteer-form AWS_ERROR_PAGES_BUCKET_NAME "$AWS_ERROR_PAGES_BUCKET_NAME"
cf set-env govuk-coronavirus-business-volunteer-form AWS_REGION "$AWS_REGION"
if [[ "${REQUIRE_BASIC_AUTH:-}" = "true" ]]; then
cf set-env govuk-coronavirus-business-volunteer-form REQUIRE_BASIC_AUTH "$REQUIRE_BASIC_AUTH"
fi
cf set-env govuk-coronavirus-business-volunteer-form BASIC_AUTH_PASSWORD "$BASIC_AUTH_PASSWORD"
cf set-env govuk-coronavirus-business-volunteer-form SENTRY_DSN "$SENTRY_DSN"
cf set-env govuk-coronavirus-business-volunteer-form SENTRY_CURRENT_ENV "$CF_SPACE"
cf set-env govuk-coronavirus-business-volunteer-form GA_VIEW_ID "$GA_VIEW_ID"
cf set-env govuk-coronavirus-business-volunteer-form GA_CROSS_DOMAIN_ID "$GA_CROSS_DOMAIN_ID"
cf set-env govuk-coronavirus-business-volunteer-form AWS_ACCESS_KEY_ID "$AWS_ACCESS_KEY_ID"
cf set-env govuk-coronavirus-business-volunteer-form AWS_SECRET_ACCESS_KEY "$AWS_SECRET_ACCESS_KEY"
cf set-env govuk-coronavirus-business-volunteer-form SECRET_KEY_BASE "$SECRET_KEY_BASE"
cf set-env govuk-coronavirus-business-volunteer-form GOVUK_NOTIFY_TEMPLATE_ID "$GOVUK_NOTIFY_TEMPLATE_ID"
cf set-env govuk-coronavirus-business-volunteer-form NOTIFY_API_KEY "$NOTIFY_API_KEY"
cf set-env govuk-coronavirus-business-volunteer-form PAAS_ENV "$CF_SPACE"
cf push govuk-coronavirus-business-volunteer-form --strategy rolling
cf map-route govuk-coronavirus-business-volunteer-form cloudapps.digital --hostname "$HOSTNAME"