diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index b86eab0e5..64dd170fe 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -118,11 +118,10 @@ jobs: CF_ORG: ${{ secrets.CF_ORG }} API_USER: ${{ secrets.API_USER }} API_KEY: ${{ secrets.API_KEY }} - APP_NAME: dluhc-core + APP_NAME: dluhc-core-staging GOVUK_NOTIFY_API_KEY: ${{ secrets.GOVUK_NOTIFY_API_KEY }} APP_HOST: ${{ secrets.APP_HOST }} RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} - MANIFEST_FILE: staging_manifest.yml run: | cf7 api $CF_API_ENDPOINT 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 APP_HOST $APP_HOST cf7 set-env $APP_NAME RAILS_MASTER_KEY $RAILS_MASTER_KEY - cf7 push --strategy rolling -f $MANIFEST_FILE + cf7 push $APP_NAME --strategy rolling diff --git a/README.md b/README.md index 48f077753..81038cdd4 100644 --- a/README.md +++ b/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: -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) 3. Login:\ `cf login -a api.london.cloud.service.gov.uk -u ` -4. Set your deployment target (sandbox/production):\ +4. Set your deployment target (staging/production):\ `cf target -o dluhc-core -s ` 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: diff --git a/infrastructure_setup.md b/infrastructure_setup.md new file mode 100644 index 000000000..28bc4b2d7 --- /dev/null +++ b/infrastructure_setup.md @@ -0,0 +1,13 @@ +# Staging + +1. Login:\ +`cf login -a api.london.cloud.service.gov.uk -u ` + +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` diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 000000000..b9fb4e670 --- /dev/null +++ b/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 diff --git a/manifest_production.yml b/manifest_production.yml deleted file mode 100644 index 709802481..000000000 --- a/manifest_production.yml +++ /dev/null @@ -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 diff --git a/manifest_staging.yml b/manifest_staging.yml deleted file mode 100644 index f314d16b1..000000000 --- a/manifest_staging.yml +++ /dev/null @@ -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