You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .controlplane/readme.md
+44-18Lines changed: 44 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -11,42 +11,63 @@ You can see the definition of Postgres and Redis in the `.controlplane/templates
11
11
## Prerequisites
12
12
13
13
1. Ensure your [Control Plane](https://controlplane.com) account is set up.
14
+
You should have an `organization``<your-org>` for testing in that account.
15
+
You will modify value for `aliases.common.cpln_org` in `.controlplane/controlplane.yml`.
16
+
If you need an organization, please [contact Shakacode](mailto:[email protected]).
14
17
15
-
2.Set up an `organization` for testing in that account and modify `aliases.common.cpln_org` in `.controlplane/controlplane.yml`.
18
+
2.Run `cpln image docker-login --org <your-org>` to ensure that you have access to the Control Plane Docker registry.
16
19
17
-
3. Install Control Plane CLI (and configure access) [docs here](https://docs.controlplane.com/quickstart/quick-start-3-cli#getting-started-with-the-cli). You can update the `cpln` command line with the same command as installation, `npm install -g @controlplane/cli`. Then run `cpln login` to ensure access.
20
+
3. Install Control Plane CLI (and configure access) using `npm install -g @controlplane/cli`.
21
+
You can update the `cpln` command line with `npm update -g @controlplane/cli`.
4. Install [Heroku to Control Plane](https://github.com/shakacode/heroku-to-control-plane) playbook CLI [`cpl` gem](https://rubygems.org/gems/cpl) on your project's Gemfile or globally.
26
+
4. Install the latest version of
27
+
[`cpl` gem](https://rubygems.org/gems/cpl)
28
+
on your project's Gemfile or globally.
29
+
For more information check out
30
+
[Heroku to Control Plane](https://github.com/shakacode/heroku-to-control-plane).
20
31
21
-
5. This project has a `Dockerfile` for Control Plane in this directory. You can use it as an example for your project. Ensure that you have Docker running.
32
+
5. This project has a `Dockerfile` for Control Plane in `.controlplane` directory.
33
+
You can use it as an example for your project.
34
+
Ensure that you have Docker running.
22
35
23
-
## Tips
24
-
Do not confuse the `cpl` CLI with the `cpln` CLI. The `cpl` CLI is the Heroku to Control Plane playbook CLI. The `cpln` CLI is the Control Plane CLI.
36
+
### Tips
37
+
Do not confuse the `cpl` CLI with the `cpln` CLI.
38
+
The `cpl` CLI is the Heroku to Control Plane playbook CLI.
39
+
The `cpln` CLI is the Control Plane CLI.
25
40
26
41
## Project Configuration
27
42
See the filese in the `./controlplane` directory.
28
43
29
44
1.`/templates`: defines the objects created with the `cpl setup` command.
30
-
2.`/controlplane.yml`: defines the organization, location, and app name.
45
+
These YAML files are the same as used by the `cpln apply` command.
46
+
2.`/controlplane.yml`: defines your application, including the organization, location, and app name.
31
47
3.`Dockerfile`: defines the Docker image used to run the app on Control Plane.
32
48
4.`entrypoint.sh`: defines the entrypoint script used to run the app on Control Plane.
33
49
34
50
## Setup and run
35
51
36
-
Check if the Control Plane organization and location are correct in `.controlplane/controlplane.yml`. You should be able to see this information in the Control Plane UI.
52
+
Check if the Control Plane organization and location are correct in `.controlplane/controlplane.yml`.
53
+
You should be able to see this information in the Control Plane UI.
37
54
38
-
```sh
39
-
# Note, below commands use `cpl` which is the Heroku to Control Plane playbook script.
55
+
**Note:** The below commands use `cpl` which is the Heroku to Control Plane playbook gem,
56
+
and not `cpln` which is the Control Plane CLI.
40
57
58
+
```sh
41
59
# Provision all infrastructure on Control Plane.
42
60
# app tutorial-app will be created per definition in .controlplane/controlplane.yml
43
-
cpl setup gvc postgres redis rails -a tutorial-app
61
+
cpl apply-template gvc postgres redis rails -a tutorial-app
44
62
45
63
# Build and push docker image to Control Plane repository
46
64
# Note, may take many minutes. Be patient.
65
+
# Check for error messages, such as forgetting to run `cpln image docker-login --org <your-org>`
47
66
cpl build-image -a tutorial-app
48
67
49
68
# Promote image to app after running `cpl build-image command`
69
+
# Note, the UX of images may not show the image for up to 5 minutes.
70
+
# However, it's ready.
50
71
cpl deploy-image -a tutorial-app
51
72
52
73
# See how app is starting up
@@ -56,25 +77,30 @@ cpl logs -a tutorial-app
56
77
cpl open -a tutorial-app
57
78
```
58
79
59
-
## Promoting code upgrades
80
+
### Promoting code updates
81
+
82
+
After committing code, you will update your deployment of `tutorial-app` with the following commands:
60
83
61
84
```sh
62
-
# Build and push new image with sequential image tagging, e.g. 'ror-tutorial_123'
85
+
# Build and push new image with sequential image tagging, e.g. 'tutorial-app:1', then 'tutorial-app:2', etc.
63
86
cpl build-image -a tutorial-app
64
87
65
-
# OR
66
-
# Build and push with sequential image tagging and commit SHA, e.g. 'ror-tutorial_123_ABCD'
67
-
cpl build-image -a tutorial-app --commit ABCD
68
-
69
88
# Run database migrations (or other release tasks) with latest image,
70
89
# while app is still running on previous image.
71
90
# This is analogous to the release phase.
72
91
cpl runner rails db:migrate -a tutorial-app --image latest
73
92
74
-
# Pomote latest image to app
93
+
# Pomote latest image to app after migrations run
75
94
cpl deploy-image -a tutorial-app
76
95
```
77
96
97
+
If you needed to push a new image with a specific commit SHA, you can run the following command:
98
+
99
+
```sh
100
+
# Build and push with sequential image tagging and commit SHA, e.g. 'tutorial-app:123_ABCD'
0 commit comments