Deploying - 18F/charlie GitHub Wiki

Charlie developer documentation > Deploying

Production

Generally, production deploys are handled automatically when pull requests are merged to the main branch. Manual deployments are possible. Check in the #bots Slack channel for help if you need to manually deploy to production.

Staging

The staging environment connects to the GSA TTS Testing Slack. It is also shut down every night, so if you are using it in active development, you will need to restart it each morning.

  • Ask for assistance in the #bots channel.
  • Contact an admin of GSA TTS Testing Slack about getting added as a user.

Automated

You can deploy a branch to the staging environment via a GitHub Action. Open the "deploy to testing" action page. On the right side of the page below the filter search box, click the button that says "Run workflow." You will be presented with a drop-down of branches. Select your testing branch and click "Run workflow" to deploy your branch into the staging environment.

Manual

If for some reason the automated staging deployments don't meet your needs, you can also deploy to staging manually.

After the above is taken care of, use cf to login to cloud.gov and connect to the gsa-18f-hubot org and select the space as dev.

Interaction should look something like this:

➜ cf login -a api.fr.cloud.gov  --sso
API endpoint: api.fr.cloud.gov

Temporary Authentication Code (Get one at https://login.fr.cloud.gov/passcode):
Authenticating...
OK


Select an org:
1. gsa-18f-hubot
2. sandbox-gsa

Org (enter to skip): 1
Targeted org gsa-18f-hubot.

Select a space:
1. dev
2. prod
3. staging

Space (enter to skip): 1
Targeted space dev.

API endpoint:   https://api.fr.cloud.gov
API version:    3.107.0
user:           <username>@gsa.gov
org:            gsa-18f-hubot
space:          dev

At any point you can make sure you are connected to the right org and space with:

cf target -o gsa-18f-hubot -s dev

Next, create the database that Charlie needs. This database is destroyed nightly to reduce unnecessary operating costs, so if you are deploying for the first time in a day, you'll need to create it.

cf create-service aws-rds micro-psql charlie-brain

Wait until the database is created before proceeding. You can check the status of the service creation with:

cf service charlie-brain | grep "  status:"

When it is finished, the status will be create succeeded. Finally, to deploy your development branch on cloud.gov, which makes it available to test on GSA TTS Testing Slack, execute this command:

cf push --vars-file ./dev.yml

Note: it takes a few minutes for the code to fully build and deploy. The console should give updates of its progress and exit to a prompt when finished.

⚠️ **GitHub.com Fallback** ⚠️