This guide assumes that you already have:
- a GitHub account and a GitHub repository, typically under the 18F GitHub organization
- a CircleCI account (Log In with GitHub)
- a cloud.gov account
1. Getting deployer credentials
Use the instructions on Cloud.gov to create a deployer account for your app. Your deployer credentials will regularly expire, so please make sure to update them periodically.
2. Configure the continuous integration service
Add your cloud.gov deployer service credentials as environment variables to CircleCI. Save them as the CF_USERNAME and CF_PASSWORD.
Cloud.gov (and Cloud Foundry) use manifest files to specify how an app should be built on cloud.gov. You will now add two separate files, a
manifest.yml for your production app and a
manifest-staging.yml for your development application.
Generally your production application will have multiple instances while your staging will only have one. Manifests can be short and sweet, or extensive. See the full cloud foundry documentation on manifests.
Zero Downtime Deploy Options
v3-zdt-pushis an official command, yet is in active development.
zero-downtime-pushis the popular Autopilot plugin used by a lot of TTS projects and used in both of the above examples. It is now unmaintained and archived though. Does not support buildpacks. If your application successfully deploys to cloud.gov but does not start, which may happen for an application that does not have an adequate test suite, you may have to go into the cf target space and manually delete the “APP_NAME-venerable” application in order to make use of
blue-green-deployanother plugin similar to autopilot.
- An official CircleCI / Cloud Foundry Orb is also available at https://circleci.com/orbs/registry/orb/circleci/cloudfoundry