Browse Source

Use a single manifest file

pull/226/head
baarkerlounger 3 years ago
parent
commit
c0d4f51236
  1. 5
      .github/workflows/pipeline.yml
  2. 6
      README.md
  3. 13
      infrastructure_setup.md
  4. 26
      manifest.yml
  5. 14
      manifest_production.yml
  6. 14
      manifest_staging.yml

5
.github/workflows/pipeline.yml

@ -118,11 +118,10 @@ jobs:
CF_ORG: ${{ secrets.CF_ORG }} CF_ORG: ${{ secrets.CF_ORG }}
API_USER: ${{ secrets.API_USER }} API_USER: ${{ secrets.API_USER }}
API_KEY: ${{ secrets.API_KEY }} API_KEY: ${{ secrets.API_KEY }}
APP_NAME: dluhc-core APP_NAME: dluhc-core-staging
GOVUK_NOTIFY_API_KEY: ${{ secrets.GOVUK_NOTIFY_API_KEY }} GOVUK_NOTIFY_API_KEY: ${{ secrets.GOVUK_NOTIFY_API_KEY }}
APP_HOST: ${{ secrets.APP_HOST }} APP_HOST: ${{ secrets.APP_HOST }}
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
MANIFEST_FILE: staging_manifest.yml
run: | run: |
cf7 api $CF_API_ENDPOINT cf7 api $CF_API_ENDPOINT
cf7 auth cf7 auth
@ -132,4 +131,4 @@ jobs:
cf7 set-env $APP_NAME GOVUK_NOTIFY_API_KEY $GOVUK_NOTIFY_API_KEY cf7 set-env $APP_NAME GOVUK_NOTIFY_API_KEY $GOVUK_NOTIFY_API_KEY
cf7 set-env $APP_NAME APP_HOST $APP_HOST cf7 set-env $APP_NAME APP_HOST $APP_HOST
cf7 set-env $APP_NAME RAILS_MASTER_KEY $RAILS_MASTER_KEY cf7 set-env $APP_NAME RAILS_MASTER_KEY $RAILS_MASTER_KEY
cf7 push --strategy rolling -f $MANIFEST_FILE cf7 push $APP_NAME --strategy rolling

6
README.md

@ -53,18 +53,18 @@ Note `docker-compose` runs the production docker image (`RAILS_ENV=production`)
This application is running on [GOV.UK PaaS](https://www.cloud.service.gov.uk/). To deploy you need to: This application is running on [GOV.UK PaaS](https://www.cloud.service.gov.uk/). To deploy you need to:
1. Contact your organisation manager to get an account in `dluhc-core` organization and in the relevant spaces (sandbox/production). 1. Contact your organisation manager to get an account in `dluhc-core` organization and in the relevant spaces (staging/production).
2. [Install the Cloud Foundry CLI](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html) 2. [Install the Cloud Foundry CLI](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html)
3. Login:\ 3. Login:\
`cf login -a api.london.cloud.service.gov.uk -u <your_username>` `cf login -a api.london.cloud.service.gov.uk -u <your_username>`
4. Set your deployment target (sandbox/production):\ 4. Set your deployment target (staging/production):\
`cf target -o dluhc-core -s <deploy_environment>` `cf target -o dluhc-core -s <deploy_environment>`
5. Deploy:\ 5. Deploy:\
`cf push dluhc-core --strategy rolling`. This will use the [manifest file](manifest.yml) `cf push dluhc-core --strategy rolling`. This will use the [manifest file](staging_manifest.yml)
Once the app is deployed: Once the app is deployed:

13
infrastructure_setup.md

@ -0,0 +1,13 @@
# Staging
1. Login:\
`cf login -a api.london.cloud.service.gov.uk -u <your_username>`
2. Set your deployment target (staging):\
`cf target -o dluhc-core -s staging`
3. Create required backing services (this will take ~15 mins to finish creating):
`cf create-service postgres tiny-unencrypted-13 dluhc-core-staging-postgres`
4. Deploy manifest:
`cf push dluhc-core-staging --strategy rolling`

26
manifest.yml

@ -0,0 +1,26 @@
---
defaults: &defaults
buildpacks:
- https://github.com/cloudfoundry/ruby-buildpack.git
processes:
- type: web
command: rake db:migrate && bin/rails server
instances: 2
memory: 512M
applications:
- name: dluhc-core-staging
<<: *defaults
env:
RAILS_ENV: staging
host: staging-submit-social-housing-lettings-sales-data.london.cloudapps.digital
services:
- dluhc-core-staging-postgres
- name: dluhc-core-production
<<: *defaults
env:
RAILS_ENV: production
host: submit-social-housing-lettings-sales-data.london.cloudapps.digital
services:
- dluhc-core-production-postgres

14
manifest_production.yml

@ -1,14 +0,0 @@
---
applications:
- name: dluhc-core
buildpacks:
- https://github.com/cloudfoundry/ruby-buildpack.git
env:
RAILS_ENV: production
processes:
- type: web
command: rake db:migrate && bin/rails server
instances: 4
memory: 512M
services:
- dluhc-core-production-postgres

14
manifest_staging.yml

@ -1,14 +0,0 @@
---
applications:
- name: dluhc-core
buildpacks:
- https://github.com/cloudfoundry/ruby-buildpack.git
env:
RAILS_ENV: staging
processes:
- type: web
command: rake db:migrate && bin/rails server
instances: 2
memory: 512M
services:
- dluhc-core-staging-postgres
Loading…
Cancel
Save