manage.get.gov/ops
Seamus Johnston a96c1b0d80
Prepare CD pipeline and sandbox
- GitHub Actions deploy workflow
- GitHub Actions database migration workflow
- CF Python Buildpack deployment manifest
- CF Python Buildpack python runtime file
- documentation
2022-08-17 13:28:17 -05:00
..
manifests Prepare CD pipeline and sandbox 2022-08-17 13:28:17 -05:00
README.md Prepare CD pipeline and sandbox 2022-08-17 13:28:17 -05:00

Operations

========================

This directory contains files related to deploying or running the application(s).

Authenticating

You'll need the Cloud Foundry CLI.

We use the V7 Cloud Foundry CLI.

cf login -a api.fr.cloud.gov --sso

After authenticating, make sure you are targeting the correct org and space!

cf spaces
cf target -o <ORG> -s <SPACE>

Rotating Secrets

Secrets were originally created with:

cf cups getgov-credentials -p credentials-<ENVIRONMENT>.json

Where credentials-<ENVIRONMENT>.json looks like:

{
  "DJANGO_SECRET_KEY": "EXAMPLE",
  ...
}

You can see the current environment with cf env <APP>, for example cf env getgov-dev.

The command cups stands for create user provided service. 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.

To rotate secrets, create a new credentials-<ENVIRONMENT>.json file, upload it, then restage the app.

Example:

cf uups getgov-credentials -p credentials-dev.json
cf restage getgov-dev --strategy rolling

Non-secret environment variables can be declared in manifest-<ENVIRONMENT>.json directly.

Database

In sandbox, created with cf create-service aws-rds micro-psql getgov-database.

Binding the database in manifest-<ENVIRONMENT>.json automatically inserts the connection string into the environment as DATABASE_URL.

Cloud.gov RDS documentation.