-
Notifications
You must be signed in to change notification settings - Fork 374
Document cpflow app bootstrap #748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -57,6 +57,21 @@ The matching Control Plane resources are: | |||||||||||
| | Staging app | `react-webpack-rails-tutorial-staging` | | ||||||||||||
| | Staging app secret dictionary | `react-webpack-rails-tutorial-staging-secrets` | | ||||||||||||
|
|
||||||||||||
| Bootstrap the persistent staging app once before the first merge-to-master | ||||||||||||
| deploy: | ||||||||||||
|
|
||||||||||||
| ```sh | ||||||||||||
| cpflow setup-app -a react-webpack-rails-tutorial-staging --org shakacode-open-source-examples-staging --skip-post-creation-hook | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| `setup-app` reads `setup_app_templates` from `.controlplane/controlplane.yml` | ||||||||||||
| and creates the app identity, app secret dictionary, app secret policy, policy | ||||||||||||
| binding, and template resources. Use `--skip-post-creation-hook` so first-time | ||||||||||||
| bootstrap does not try to run database setup before a Docker image exists. For | ||||||||||||
| later template updates on an existing persistent app, use | ||||||||||||
| `cpflow apply-template` and make sure the app identity still has `reveal` | ||||||||||||
| permission on the app secret policy. | ||||||||||||
|
|
||||||||||||
| ### Production Promotion | ||||||||||||
|
|
||||||||||||
| Production promotion is part of the default demo flow, but the production token | ||||||||||||
|
|
@@ -81,6 +96,9 @@ The matching Control Plane resources are: | |||||||||||
| | Production app | `react-webpack-rails-tutorial-production` | | ||||||||||||
| | Production app secret dictionary | `react-webpack-rails-tutorial-production-secrets` | | ||||||||||||
|
|
||||||||||||
| Bootstrap production the same way before the first promotion, using the | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The staging section above gives the full explicit command; this production note only says "the same way" without showing it. A reader who lands on the Production section directly (or who uses different org/app names) has to scroll up and mentally substitute values. Consider showing the production-specific command here, as
Suggested change
Use the production org and production-only secret values. |
||||||||||||
| production org and production-only secret values. | ||||||||||||
|
|
||||||||||||
| All review, staging, and production secret dictionaries need these app runtime | ||||||||||||
| secrets: | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,6 +39,16 @@ Optional overrides exist for forks, clones, and unusual apps: | |||||||||||
| ## Staging And Production | ||||||||||||
|
|
||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no blank line between the existing "Staging deploys use the same..." sentence and this new paragraph. Without one, the two sentences render as a single paragraph in Markdown. Adding a blank line makes the boundary between the context sentence and the action step clear.
Suggested change
|
||||||||||||
| Staging deploys use the same `CPLN_TOKEN_STAGING` secret plus `STAGING_APP_NAME`. | ||||||||||||
| Before the first staging deploy, bootstrap the persistent staging app once: | ||||||||||||
|
Comment on lines
41
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
|
||||||||||||
| ```sh | ||||||||||||
| cpflow setup-app -a "$STAGING_APP_NAME" --org "$CPLN_ORG_STAGING" --skip-post-creation-hook | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| `setup-app` creates the app identity, app secret dictionary, app secret policy, | ||||||||||||
| policy binding, and template resources. For later template updates on an | ||||||||||||
| existing persistent app, use `cpflow apply-template` and make sure the app | ||||||||||||
| identity has `reveal` permission on the app secret policy. | ||||||||||||
|
|
||||||||||||
| Production promotion is part of the generated flow, but keep it protected: | ||||||||||||
|
|
||||||||||||
|
|
@@ -53,6 +63,9 @@ prevent self-review. The generated promotion wrapper passes only the staging | |||||||||||
| token from repository secrets; GitHub injects `CPLN_TOKEN_PRODUCTION` only after | ||||||||||||
| the environment approval gate passes. | ||||||||||||
|
|
||||||||||||
| Before the first promotion, bootstrap the production app the same way in the | ||||||||||||
| production org, using production-only secrets and values. | ||||||||||||
|
|
||||||||||||
| ## Version Locking | ||||||||||||
|
|
||||||||||||
| Generated wrappers pin Control Plane Flow once with the reusable workflow | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apply-templatefor persistent app bootstrapThis new guidance tells operators to run
cpflow setup-appfor the persistent staging app, but the upstream command docs explicitly scopesetup-appto temporary apps and direct persistent staging/production flows tocpflow apply-template. If someone follows this during first-time staging/production setup, they can run an unsupported path that creates/recreates full app resources instead of the documented persistent update flow, which risks unexpected infra changes in long-lived environments.Useful? React with 👍 / 👎.