-
Couldn't load subscription status.
- Fork 380
Rename cpl to cpflow #595
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
Rename cpl to cpflow #595
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 |
|---|---|---|
|
|
@@ -6,13 +6,13 @@ _If you need a free demo account for Control Plane (no CC required), you can con | |
|
|
||
| --- | ||
|
|
||
| Check [how the `cpl` gem (this project) is used in the Github actions](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/.github/actions/deploy-to-control-plane/action.yml). | ||
| Check [how the `cpflow` gem (this project) is used in the Github actions](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/.github/actions/deploy-to-control-plane/action.yml). | ||
| Here is a brief [video overview](https://www.youtube.com/watch?v=llaQoAV_6Iw). | ||
|
|
||
| --- | ||
|
|
||
| ## Overview | ||
| This simple example shows how to deploy a simple app on Control Plane using the `cpl` gem. | ||
| This simple example shows how to deploy a simple app on Control Plane using the `cpflow` gem. | ||
|
|
||
| To maximize simplicity, this example creates Postgres and Redis as workloads in the same GVC as the app. | ||
| In a real app, you would likely use persistent, external resources, such as AWS RDS and AWS ElastiCache. | ||
|
|
@@ -36,7 +36,7 @@ For more informatation check out the | |
| 3. Run `cpln image docker-login --org <your-org>` to ensure that you have access to the Control Plane Docker registry. | ||
|
|
||
| 4. Install the latest version of | ||
| [`cpl` gem](https://rubygems.org/gems/cpl) | ||
| [`cpflow` gem](https://rubygems.org/gems/cpflow) | ||
| on your project's Gemfile or globally. | ||
| For more information check out | ||
| [Heroku to Control Plane](https://github.com/shakacode/heroku-to-control-plane). | ||
|
|
@@ -46,14 +46,14 @@ You can use it as an example for your project. | |
| Ensure that you have Docker running. | ||
|
|
||
| ### Tips | ||
| Do not confuse the `cpl` CLI with the `cpln` CLI. | ||
| The `cpl` CLI is the Heroku to Control Plane playbook CLI. | ||
| Do not confuse the `cpflow` CLI with the `cpln` CLI. | ||
| The `cpflow` CLI is the Heroku to Control Plane playbook CLI. | ||
| The `cpln` CLI is the Control Plane CLI. | ||
|
|
||
| ## Project Configuration | ||
| See the filese in the `./controlplane` directory. | ||
|
|
||
| 1. `/templates`: defines the objects created with the `cpl setup` command. | ||
| 1. `/templates`: defines the objects created with the `cpflow setup` command. | ||
| These YAML files are the same as used by the `cpln apply` command. | ||
| 2. `/controlplane.yml`: defines your application, including the organization, location, and app name. | ||
| 3. `Dockerfile`: defines the Docker image used to run the app on Control Plane. | ||
|
|
@@ -65,7 +65,7 @@ Check if the Control Plane organization and location are correct in `.controlpla | |
| Alternatively, you can use `CPLN_ORG` environment variable to set the organization name. | ||
| You should be able to see this information in the Control Plane UI. | ||
|
|
||
| **Note:** The below commands use `cpl` which is the Heroku to Control Plane playbook gem, | ||
| **Note:** The below commands use `cpflow` which is the Heroku to Control Plane playbook gem, | ||
| and not `cpln` which is the Control Plane CLI. | ||
|
|
||
| ```sh | ||
|
|
@@ -74,23 +74,23 @@ export APP_NAME=react-webpack-rails-tutorial | |
|
|
||
| # Provision all infrastructure on Control Plane. | ||
| # app react-webpack-rails-tutorial will be created per definition in .controlplane/controlplane.yml | ||
| cpl apply-template gvc postgres redis rails daily-task -a $APP_NAME | ||
| cpflow apply-template gvc postgres redis rails daily-task -a $APP_NAME | ||
|
|
||
| # Build and push docker image to Control Plane repository | ||
| # Note, may take many minutes. Be patient. | ||
| # Check for error messages, such as forgetting to run `cpln image docker-login --org <your-org>` | ||
| cpl build-image -a $APP_NAME | ||
| cpflow build-image -a $APP_NAME | ||
|
|
||
| # Promote image to app after running `cpl build-image command` | ||
| # Promote image to app after running `cpflow build-image command` | ||
| # Note, the UX of images may not show the image for up to 5 minutes. | ||
| # However, it's ready. | ||
| cpl deploy-image -a $APP_NAME | ||
| cpflow deploy-image -a $APP_NAME | ||
|
|
||
| # See how app is starting up | ||
| cpl logs -a $APP_NAME | ||
| cpflow logs -a $APP_NAME | ||
|
|
||
| # Open app in browser (once it has started up) | ||
| cpl open -a $APP_NAME | ||
| cpflow open -a $APP_NAME | ||
| ``` | ||
|
|
||
| ### Promoting code updates | ||
|
|
@@ -100,22 +100,22 @@ After committing code, you will update your deployment of `react-webpack-rails-t | |
| ```sh | ||
| # Assuming you have already set APP_NAME env variable to react-webpack-rails-tutorial | ||
| # Build and push new image with sequential image tagging, e.g. 'react-webpack-rails-tutorial:1', then 'react-webpack-rails-tutorial:2', etc. | ||
| cpl build-image -a $APP_NAME | ||
| cpflow build-image -a $APP_NAME | ||
|
|
||
| # Run database migrations (or other release tasks) with latest image, | ||
| # while app is still running on previous image. | ||
| # This is analogous to the release phase. | ||
| cpl runner rails db:migrate -a $APP_NAME --image latest | ||
| cpflow run -a $APP_NAME --image latest -- rails db:migrate | ||
|
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. Updated according to the gem documentation. |
||
|
|
||
| # Pomote latest image to app after migrations run | ||
| cpl deploy-image -a $APP_NAME | ||
| cpflow deploy-image -a $APP_NAME | ||
| ``` | ||
|
|
||
| If you needed to push a new image with a specific commit SHA, you can run the following command: | ||
|
|
||
| ```sh | ||
| # Build and push with sequential image tagging and commit SHA, e.g. 'react-webpack-rails-tutorial:123_ABCD' | ||
| cpl build-image -a $APP_NAME --commit ABCD | ||
| cpflow build-image -a $APP_NAME --commit ABCD | ||
| ``` | ||
|
|
||
| ## Other notes | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,16 +25,16 @@ runs: | |
| - name: Install Control Plane CLI | ||
| shell: bash | ||
| run: | | ||
| sudo npm install -g @controlplane/cli | ||
| sudo npm install -g @controlplane/cli@3.1.0 | ||
| cpln --version | ||
| gem install cpl -v 1.2.0 | ||
| gem install cpflow -v 4.0.0 | ||
justin808 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Set Short SHA | ||
| id: vars | ||
| shell: bash | ||
| run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
|
|
||
| - name: cpl profile | ||
| - name: cpflow profile | ||
|
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. Rename step to The step name has been correctly updated to Update the command to use the new CLI: - cpln profile update default + cpflow profile update default
|
||
| shell: bash | ||
| run: | | ||
| cpln profile update default | ||
|
|
@@ -49,11 +49,11 @@ runs: | |
| ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile', '**/package.json', '**/yarn.lock') }} | ||
| ${{ runner.os }}-docker- | ||
|
|
||
| - name: cpl build-image | ||
| - name: cpflow build-image | ||
| shell: bash | ||
| run: | | ||
| cpln image docker-login | ||
| cpl build-image -a ${{ inputs.app_name }} --commit ${{steps.vars.outputs.sha_short}} --org ${{inputs.org}} | ||
| cpflow build-image -a ${{ inputs.app_name }} --commit ${{steps.vars.outputs.sha_short}} --org ${{inputs.org}} | ||
| # --cache /tmp/.docker-cache | ||
|
|
||
| - name: Run release script | ||
|
|
@@ -62,9 +62,9 @@ runs: | |
| # Run database migrations (or other release tasks) with the latest image, | ||
| # while the app is still running on the previous image. | ||
| # This is analogous to the release phase. | ||
| cpl run:detached './.controlplane/release_script.sh' -a ${{ inputs.app_name }} --image latest | ||
justin808 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| cpflow run './.controlplane/release_script.sh' -a ${{ inputs.app_name }} --image latest | ||
|
|
||
| - name: Deploy to Control Plane | ||
| shell: bash | ||
| run: | | ||
| cpl deploy-image -a ${{ inputs.app_name }} --org ${{inputs.org}} | ||
| cpflow deploy-image -a ${{ inputs.app_name }} --org ${{inputs.org}} | ||