Skip to content

Commit

Permalink
PP-6085 Add env-map buildpack
Browse files Browse the repository at this point in the history
Add a build pack that extracts values from within VCAP_SERVICES which is
where the credentials from bound services will be provided to the app
running on PaaS. Using this buildpack means we do not need to alter how
our app works, but rather provide a mapping from the VCAP_SERVICES var to its
current name.
  • Loading branch information
danworth committed Feb 3, 2020
1 parent 5f477f0 commit 196ebfc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions env-map.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
env_vars:
ADMINUSERS_URL: '."user-provided"[0].credentials.adminusers_url'
PRODUCTS_URL: '."user-provided"[0].credentials.products_url'
SELFSERVICE_TRANSACTIONS_URL: '."user-provided"[0].credentials.selfservice_transactions_url'
13 changes: 8 additions & 5 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
applications:
- name: products-ui
buildpacks:
- https://github.com/alphagov/env-map-buildpack.git#v1
- nodejs_buildpack
health-check-type: http
health-check-http-endpoint: '/healthcheck'
health-check-invocation-timeout: 5
memory: ((memory))
disk_quota: ((disk_quota))
services:
- app-catalog
command: npm start
env:
ADMINUSERS_URL: ((adminusers_url))
ANALYTICS_TRACKING_ID: ((analytics_tracking_id))
COOKIE_MAX_AGE: '5400000'
CORRELATION_HEADER_NAME: x-request-id
Expand All @@ -20,8 +22,9 @@ applications:
METRICS_HOST: ((metrics_host))
NODE_ENV: production
NODE_WORKER_COUNT: '1'
PRODUCTS_URL: ((products_url))
SELFSERVICE_TRANSACTIONS_URL: ((selfservice_transactions_url))
SESSION_ENCRYPTION_KEY: ((session_encryption_key))
routes:
- route: ((products_ui_route))

# These are taken via bound service, see `env-map.yml`
ADMINUSERS_URL: ""
PRODUCTS_URL: ""
SELFSERVICE_TRANSACTIONS_URL: ""

0 comments on commit 196ebfc

Please sign in to comment.