Rename environments for consistency

- dev is local laptop
- unstable (or sandbox) is latest cut of main (or for experiments)
- staging is stable tagged releases
This commit is contained in:
Seamus Johnston 2022-08-18 14:54:14 -05:00
parent e45da58a4a
commit 8ec4d40b6a
No known key found for this signature in database
GPG key ID: 2F21225985069105
5 changed files with 18 additions and 19 deletions

View file

@ -17,9 +17,9 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
deploy-dev: deploy-unstable:
# if this job runs on a branch, we deduce that code # if this job runs on a branch, we deduce that code
# has been pushed to main and should be deployed to dev # has been pushed to main and should be deployed to unstable
if: ${{ github.ref_type == 'branch' }} if: ${{ github.ref_type == 'branch' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -34,10 +34,9 @@ jobs:
cf_password: ${{ secrets.CF_PASSWORD }} cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: sandbox-gsa cf_org: sandbox-gsa
cf_space: dotgov-poc cf_space: dotgov-poc
push_arguments: "-f ops/manifests/manifest-dev.yaml" push_arguments: "-f ops/manifests/manifest-unstable.yaml"
# deploy: # deploy-staging:
# # if this job runs on a tag, we deduce that code # # if this job runs on a tag, we deduce that code
# # has been tagged for release and should be deployed to # # has been tagged for release and should be deployed to staging
# # ____? (staging? prod?)
# if: ${{ github.ref_type == 'tag' }} # if: ${{ github.ref_type == 'tag' }}

View file

@ -3,7 +3,7 @@ name: Run Migrations
# This workflow can be run from the CLI # This workflow can be run from the CLI
# gh workflow run migrate.yaml -f environment=sandbox # gh workflow run migrate.yaml -f environment=sandbox
# OR # OR
# cf run-task getgov-dev --wait \ # cf run-task getgov-unstable --wait \
# --command 'python manage.py migrate' --name migrate # --command 'python manage.py migrate' --name migrate
on: on:
@ -13,22 +13,22 @@ on:
type: choice type: choice
description: Where should we run migrations description: Where should we run migrations
options: options:
- sandbox - unstable
- production - staging
jobs: jobs:
migrate-dev: migrate-unstable:
if: ${{ github.event.inputs.environment == 'sandbox' }} if: ${{ github.event.inputs.environment == 'unstable' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Run Django migrations for sandbox - name: Run Django migrations for unstable
uses: 18f/cg-deploy-action@main uses: 18f/cg-deploy-action@main
with: with:
cf_username: ${{ secrets.CF_USERNAME }} cf_username: ${{ secrets.CF_USERNAME }}
cf_password: ${{ secrets.CF_PASSWORD }} cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: sandbox-gsa cf_org: sandbox-gsa
cf_space: dotgov-poc cf_space: dotgov-poc
full_command: "cf run-task getgov-dev --wait --command 'python manage.py migrate' --name migrate" full_command: "cf run-task getgov-unstable --wait --command 'python manage.py migrate' --name migrate"
# migrate: # migrate:
# if: ${{ github.event.inputs.environment == 'production' }} # if: ${{ github.event.inputs.environment == 'staging' }}

View file

@ -35,7 +35,7 @@ Where `credentials-<ENVIRONMENT>.json` looks like:
} }
``` ```
You can see the current environment with `cf env <APP>`, for example `cf env getgov-dev`. You can see the current environment with `cf env <APP>`, for example `cf env getgov-unstable`.
The command `cups` stands for [create user provided service](https://docs.cloudfoundry.org/devguide/services/user-provided.html). User provided services are the way currently recommended by Cloud.gov for deploying secrets. The user provided service is bound to the application in `manifest-<ENVIRONMENT>.json`. The command `cups` stands for [create user provided service](https://docs.cloudfoundry.org/devguide/services/user-provided.html). User provided services are the way currently recommended by Cloud.gov for deploying secrets. The user provided service is bound to the application in `manifest-<ENVIRONMENT>.json`.
@ -45,7 +45,7 @@ Example:
```bash ```bash
cf uups getgov-credentials -p credentials-unstable.json cf uups getgov-credentials -p credentials-unstable.json
cf restage getgov-dev --strategy rolling cf restage getgov-unstable --strategy rolling
``` ```
Non-secret environment variables can be declared in `manifest-<ENVIRONMENT>.json` directly. Non-secret environment variables can be declared in `manifest-<ENVIRONMENT>.json` directly.

View file

@ -1,6 +1,6 @@
--- ---
applications: applications:
- name: getgov-dev - name: getgov-unstable
buildpacks: buildpacks:
- python_buildpack - python_buildpack
path: ../../src path: ../../src
@ -17,7 +17,7 @@ applications:
# Tell Django where to find its configuration # Tell Django where to find its configuration
DJANGO_SETTINGS_MODULE: registrar.config.settings DJANGO_SETTINGS_MODULE: registrar.config.settings
routes: routes:
- route: getgov-dev.app.cloud.gov - route: getgov-unstable.app.cloud.gov
services: services:
- getgov-credentials - getgov-credentials
- getgov-database - getgov-database

View file

@ -44,7 +44,7 @@ DEBUG = env.bool("DJANGO_DEBUG", default=False)
# TODO: configure and document security settings # TODO: configure and document security settings
ALLOWED_HOSTS = [ ALLOWED_HOSTS = [
'getgov-dev.app.cloud.gov', 'getgov-unstable.app.cloud.gov',
'get.gov' 'get.gov'
] ]
ALLOWED_CIDR_NETS = ['10.0.0.0/8'] # nosec ALLOWED_CIDR_NETS = ['10.0.0.0/8'] # nosec