CI Automation, Review Apps, Staging, and Promoting to Production

Setting up Tokens for CI Automation

This example uses Github Actions. The same applies to Circle CI and other similar CI/CD tools.

  1. Ensure that you have two orgs:
  2. company-staging (for staging deployments, developers have access)
  3. company-production (for production deployments, limited access)
  4. Create the token for staging org and set on Github repository secrets and variables:
  5. Go to the Control Plane UI for your organization's staging org
  6. Make a new service account called github-actions-staging
  7. Assign to the group superusers
  8. Click "Keys" and create a one with description "Github Actions" and copy the token (or download it).
  9. Add this key to your Github repository secrets as CPLN_TOKEN_STAGING
  10. Add another key to your Github repository variables as CPLN_ORG_STAGING with the name of the staging org, like company-staging
  11. Create the token for production org, and set on Github repository secrets and variables.
  12. Go to the Control Plane UI for your organization's production org
  13. Make a new service account called github-actions-production
  14. Assign to the group superusers
  15. Click "Keys" and create a one with description "Github Actions" and copy the token (or download it).
  16. Add this key to your Github repository secrets as CPLN_TOKEN_PRODUCTION
  17. Add another key to your Github repository variables as CPLN_ORG_PRODUCTION with the name of the production org, like company-production
  18. Create a few more ENV variables for the app name and the app prefix:
  19. STAGING_APP_NAME - the name of the app in Control Plane for staging, which is the GVC name, like app-name-staging
  20. PRODUCTION_APP_NAME - the name of the app in Control Plane for production, which is the GVC name, like app-name-production
  21. REVIEW_APP_PREFIX - the prefix for the review apps in Control Plane. The Review apps are named $REVIEW_APP_PREFIX-pr-$PR_NUMBER
  22. All in all, you should have 2 secrets and 5 variables set in your Github repository