|
| 1 | +# CI Automation, Review Apps, Staging, and Promoting to Production |
| 2 | + |
| 3 | +## Setting up Tokens for CI Automation |
| 4 | + |
| 5 | +The examples uses Github Actions as an example. The same applies to Circle CI and other similar CI/CD tools. |
| 6 | + |
| 7 | +1. Ensure that you have two orgs: |
| 8 | + 1. `company-staging` (for staging deployments, developers have access) |
| 9 | + 2. `company-production` (for production deployments, limited access) |
| 10 | +2. Create the token for staging org and set on Github repository secrets and variables: |
| 11 | + 1. Go to the Control Plane UI for your organization's staging org |
| 12 | + 2. Make a new service account called `github-actions-staging` |
| 13 | + 3. Assign to the group `superusers` |
| 14 | + 4. Click "Keys" and create a one with description "Github Actions" and copy the token (or download it). |
| 15 | + 5. Add this key to your Github repository **secrets** as `CPLN_TOKEN_STAGING` |
| 16 | + 6. Add another key to your Github repository **variables** as `CPLN_ORG_STAGING` with the name of the staging org, like `company-staging` |
| 17 | +3. Create the token for production org, and set on Github repository secrets and variables. |
| 18 | + 1. Go to the Control Plane UI for your organization's production org |
| 19 | + 2. Make a new service account called `github-actions-production` |
| 20 | + 3. Assign to the group `superusers` |
| 21 | + 4. Click "Keys" and create a one with description "Github Actions" and copy the token (or download it). |
| 22 | + 5. Add this key to your Github repository **secrets** as `CPLN_TOKEN_PRODUCTION` |
| 23 | + 6. Add another key to your Github repository **variables** as `CPLN_ORG_PRODUCTION` with the name of the production org, like `company-production` |
| 24 | +4. Create a few more ENV **variables** for the app name and the app prefix: |
| 25 | + 1. `STAGING_APP_NAME` - the name of the app in Control Plane for staging, which is the GVC name, like `app-name-staging` |
| 26 | + 2. `PRODUCTION_APP_NAME` - the name of the app in Control Plane for production, which is the GVC name, like `app-name-production` |
| 27 | + 3. `REVIEW_APP_PREFIX` - the prefix for the review apps in Control Plane. The Review apps are named `$REVIEW_APP_PREFIX-pr-$PR_NUMBER` |
| 28 | +5. All in all, you should have 7 secrets set in your Github repository |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +3. Go to the Control Plane UI for your organization's staging org |
| 33 | +3. and make a new service account |
0 commit comments