Skip to content

Latest commit

 

History

History
90 lines (69 loc) · 3.05 KB

production.md

File metadata and controls

90 lines (69 loc) · 3.05 KB

18F's Production Deployment of C2

Live at https://cap.18f.gov.

18F's deployments of C2 live in AWS, and are deployed via Cloud Foundry. See the 18F Cloud Foundry documentation for more details on how to inspect and configure them.

Once you're set up with Cloud Foundry, open a new issue in the DevOps repo to ask for access to the "cap" organization. Include your GSA email address in the request.

Environments

Within Cloud Foundry, our application environments are organized like so:

organization: cap
|
+ – space: general
    |
    + – apps:
        |
        + – c2-dev
        + - c2-staging
        + - c2-prod

Deploying

  1. Check out the commit you want to deploy.
  2. Run git status and ensure that you have a clean working directory.
  3. If your deploy has a destructive migration,
    • Take a snapshot of the database.
    • Note that you may see exceptions if doing a zero-downtime deployment, as the old copies of the application are expecting the old data format.
  4. Install cf-blue-green v0.2.1+.
  5. Run cf target -o cap -s general.
  6. Deploy the application
    • If you want to do an official "release" to production, run ./script/release, which will:
      1. Tag the release.
      2. Do a zero-downtime deployment to the c2-prod application in Cloud Foundry.
      3. Push the tag to the repository on GitHub.
    • If you want to do a zero-downtime deployment to another environment, run ./script/deploy <appname>.

We use Mandrill for sending transactional emails.

Getting access

  1. Create a MailChimp account.
  2. Ask to be added to the MailChimp account.
    1. Open an issue in the devops repo. Include the GSA email address you used to sign up for Mailchimp.
    2. Assign the issue to @afeld.

Signing in

  1. Log in to MailChimp.
    • If you have multiple options, select the "General Services Administration | 18F" account.
  2. Click "Reports".
  3. Click "View Mandrill Reports".

You should now be signed in to Mandrill with the shared account.

Admin accounts

18F developers can give admin access to users in the system. Here is an example:

# on localhost
% cd /tmp
% git checkout [email protected]:18F/C2.git
% cd C2
% script/cssh c2-prod
vcap@someinstance:~$ rails console
Loading production environment (Rails 4.2.4)
irb(main):001:0> u = User.find_by_email_address '[email protected]'
irb(main):002:0> u.add_role('admin')
irb(main):003:0> u.save!
^D
vcap@someinstance:~$ exit

Logging

All application logs are stored via https://logs.cloud.gov/.

Logs are searchable via the Kibana UI, and are retained for 180 days.