Skip to content

Commit dccf95f

Browse files
Rename cpl to cpflow (#595)
* Rename cpl to cpflow' * chore: upgrade cpflow to v4 --------- Co-authored-by: Ramez Weissa <[email protected]>
1 parent 2689a46 commit dccf95f

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

.controlplane/controlplane.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Configuration for `cpl` commands.
1+
# Configuration for `cpflow` commands.
22

33
# Keys beginning with "cpln_" correspond to your settings in Control Plane.
44

5-
# Global settings that apply to `cpl` usage.
5+
# Global settings that apply to `cpflow` usage.
66
# You can opt out of allowing the use of CPLN_ORG and CPLN_APP env vars
77
# to avoid any accidents with the wrong org / app.
88
allow_org_override_by_env: true
@@ -13,7 +13,7 @@ aliases:
1313
# Org for staging and QA apps is typically set as an alias, shared by all apps, except for production apps.
1414
# Production apps will use a different org than staging for security.
1515
# Change this value to your org name
16-
# or set ENV CPLN_ORG to your org name as that will override whatever is used here for all cpl commands
16+
# or set ENV CPLN_ORG to your org name as that will override whatever is used here for all cpflow commands
1717
# cpln_org: shakacode-open-source-examples
1818

1919
# Example apps use only location. CPLN offers the ability to use multiple locations.
@@ -53,7 +53,7 @@ apps:
5353
<<: *common
5454
# QA Apps are like Heroku review apps, but the use `prefix` so you can run a commmand like
5555
# this to create a QA app for the tutorial app.
56-
# `cpl setup gvc postgres redis rails -a qa-react-webpack-rails-tutorial-pr-1234`
56+
# `cpflow setup gvc postgres redis rails -a qa-react-webpack-rails-tutorial-pr-1234`
5757
qa-react-webpack-rails-tutorial:
5858
<<: *common
5959
# Prefix is used to identify these "qa" apps.

.controlplane/readme.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ _If you need a free demo account for Control Plane (no CC required), you can con
66

77
---
88

9-
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).
9+
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).
1010
Here is a brief [video overview](https://www.youtube.com/watch?v=llaQoAV_6Iw).
1111

1212
---
1313

1414
## Overview
15-
This simple example shows how to deploy a simple app on Control Plane using the `cpl` gem.
15+
This simple example shows how to deploy a simple app on Control Plane using the `cpflow` gem.
1616

1717
To maximize simplicity, this example creates Postgres and Redis as workloads in the same GVC as the app.
1818
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
3636
3. Run `cpln image docker-login --org <your-org>` to ensure that you have access to the Control Plane Docker registry.
3737

3838
4. Install the latest version of
39-
[`cpl` gem](https://rubygems.org/gems/cpl)
39+
[`cpflow` gem](https://rubygems.org/gems/cpflow)
4040
on your project's Gemfile or globally.
4141
For more information check out
4242
[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.
4646
Ensure that you have Docker running.
4747

4848
### Tips
49-
Do not confuse the `cpl` CLI with the `cpln` CLI.
50-
The `cpl` CLI is the Heroku to Control Plane playbook CLI.
49+
Do not confuse the `cpflow` CLI with the `cpln` CLI.
50+
The `cpflow` CLI is the Heroku to Control Plane playbook CLI.
5151
The `cpln` CLI is the Control Plane CLI.
5252

5353
## Project Configuration
5454
See the filese in the `./controlplane` directory.
5555

56-
1. `/templates`: defines the objects created with the `cpl setup` command.
56+
1. `/templates`: defines the objects created with the `cpflow setup` command.
5757
These YAML files are the same as used by the `cpln apply` command.
5858
2. `/controlplane.yml`: defines your application, including the organization, location, and app name.
5959
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
6565
Alternatively, you can use `CPLN_ORG` environment variable to set the organization name.
6666
You should be able to see this information in the Control Plane UI.
6767

68-
**Note:** The below commands use `cpl` which is the Heroku to Control Plane playbook gem,
68+
**Note:** The below commands use `cpflow` which is the Heroku to Control Plane playbook gem,
6969
and not `cpln` which is the Control Plane CLI.
7070

7171
```sh
@@ -74,23 +74,23 @@ export APP_NAME=react-webpack-rails-tutorial
7474

7575
# Provision all infrastructure on Control Plane.
7676
# app react-webpack-rails-tutorial will be created per definition in .controlplane/controlplane.yml
77-
cpl apply-template gvc postgres redis rails daily-task -a $APP_NAME
77+
cpflow apply-template gvc postgres redis rails daily-task -a $APP_NAME
7878

7979
# Build and push docker image to Control Plane repository
8080
# Note, may take many minutes. Be patient.
8181
# Check for error messages, such as forgetting to run `cpln image docker-login --org <your-org>`
82-
cpl build-image -a $APP_NAME
82+
cpflow build-image -a $APP_NAME
8383

84-
# Promote image to app after running `cpl build-image command`
84+
# Promote image to app after running `cpflow build-image command`
8585
# Note, the UX of images may not show the image for up to 5 minutes.
8686
# However, it's ready.
87-
cpl deploy-image -a $APP_NAME
87+
cpflow deploy-image -a $APP_NAME
8888

8989
# See how app is starting up
90-
cpl logs -a $APP_NAME
90+
cpflow logs -a $APP_NAME
9191

9292
# Open app in browser (once it has started up)
93-
cpl open -a $APP_NAME
93+
cpflow open -a $APP_NAME
9494
```
9595

9696
### Promoting code updates
@@ -100,22 +100,22 @@ After committing code, you will update your deployment of `react-webpack-rails-t
100100
```sh
101101
# Assuming you have already set APP_NAME env variable to react-webpack-rails-tutorial
102102
# Build and push new image with sequential image tagging, e.g. 'react-webpack-rails-tutorial:1', then 'react-webpack-rails-tutorial:2', etc.
103-
cpl build-image -a $APP_NAME
103+
cpflow build-image -a $APP_NAME
104104

105105
# Run database migrations (or other release tasks) with latest image,
106106
# while app is still running on previous image.
107107
# This is analogous to the release phase.
108-
cpl runner rails db:migrate -a $APP_NAME --image latest
108+
cpflow run -a $APP_NAME --image latest -- rails db:migrate
109109

110110
# Pomote latest image to app after migrations run
111-
cpl deploy-image -a $APP_NAME
111+
cpflow deploy-image -a $APP_NAME
112112
```
113113

114114
If you needed to push a new image with a specific commit SHA, you can run the following command:
115115

116116
```sh
117117
# Build and push with sequential image tagging and commit SHA, e.g. 'react-webpack-rails-tutorial:123_ABCD'
118-
cpl build-image -a $APP_NAME --commit ABCD
118+
cpflow build-image -a $APP_NAME --commit ABCD
119119
```
120120

121121
## Other notes

.github/actions/deploy-to-control-plane/action.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ runs:
2525
- name: Install Control Plane CLI
2626
shell: bash
2727
run: |
28-
sudo npm install -g @controlplane/cli
28+
sudo npm install -g @controlplane/cli@3.1.0
2929
cpln --version
30-
gem install cpl -v 1.2.0
30+
gem install cpflow -v 4.0.0
3131
3232
- name: Set Short SHA
3333
id: vars
3434
shell: bash
3535
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
3636

37-
- name: cpl profile
37+
- name: cpflow profile
3838
shell: bash
3939
run: |
4040
cpln profile update default
@@ -49,11 +49,11 @@ runs:
4949
${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile', '**/package.json', '**/yarn.lock') }}
5050
${{ runner.os }}-docker-
5151
52-
- name: cpl build-image
52+
- name: cpflow build-image
5353
shell: bash
5454
run: |
5555
cpln image docker-login
56-
cpl build-image -a ${{ inputs.app_name }} --commit ${{steps.vars.outputs.sha_short}} --org ${{inputs.org}}
56+
cpflow build-image -a ${{ inputs.app_name }} --commit ${{steps.vars.outputs.sha_short}} --org ${{inputs.org}}
5757
# --cache /tmp/.docker-cache
5858
5959
- name: Run release script
@@ -62,9 +62,9 @@ runs:
6262
# Run database migrations (or other release tasks) with the latest image,
6363
# while the app is still running on the previous image.
6464
# This is analogous to the release phase.
65-
cpl run:detached './.controlplane/release_script.sh' -a ${{ inputs.app_name }} --image latest
65+
cpflow run './.controlplane/release_script.sh' -a ${{ inputs.app_name }} --image latest
6666
6767
- name: Deploy to Control Plane
6868
shell: bash
6969
run: |
70-
cpl deploy-image -a ${{ inputs.app_name }} --org ${{inputs.org}}
70+
cpflow deploy-image -a ${{ inputs.app_name }} --org ${{inputs.org}}

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
## Control Plane Deployment Example
99

10-
[Control Plane](https://shakacode.controlplane.com) offers a viable, cost-saving alternative to Heroku, especially when using the [cpl gem](https://rubygems.org/gems/cpl) to deploy to Control Plane.
10+
[Control Plane](https://shakacode.controlplane.com) offers a viable, cost-saving alternative to Heroku, especially when using the [cpflow gem](https://rubygems.org/gems/cpflow) to deploy to Control Plane.
1111

1212
ShakaCode recently migrated [HiChee.com](https://hichee.com) to Control Plane, resulting in a two-thirds reduction in server hosting costs!
1313

1414
See doc in [./.controlplane/readme.md](./.controlplane/readme.md) for how to easily deploy this app to Control Plane.
1515

16-
The instructions leverage the `cpl` CLI, with source code and many more tips on how to migrate from Heroku to Control Plane
16+
The instructions leverage the `cpflow` CLI, with source code and many more tips on how to migrate from Heroku to Control Plane
1717
in https://github.com/shakacode/heroku-to-control-plane.
1818

1919
----

0 commit comments

Comments
 (0)