cpl 1.4.0 → 2.0.0.rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/command_docs.yml +1 -1
  3. data/.github/workflows/rspec-shared.yml +56 -0
  4. data/.github/workflows/rspec.yml +19 -31
  5. data/.github/workflows/rubocop.yml +2 -10
  6. data/.gitignore +2 -0
  7. data/.simplecov_spawn.rb +10 -0
  8. data/CHANGELOG.md +8 -0
  9. data/CONTRIBUTING.md +32 -2
  10. data/Gemfile.lock +34 -29
  11. data/README.md +34 -25
  12. data/cpl.gemspec +1 -1
  13. data/docs/commands.md +54 -54
  14. data/docs/dns.md +6 -0
  15. data/docs/migrating.md +10 -10
  16. data/docs/tips.md +12 -10
  17. data/examples/circleci.yml +3 -3
  18. data/examples/controlplane.yml +25 -16
  19. data/lib/command/apply_template.rb +9 -9
  20. data/lib/command/base.rb +132 -37
  21. data/lib/command/build_image.rb +4 -9
  22. data/lib/command/cleanup_stale_apps.rb +1 -1
  23. data/lib/command/copy_image_from_upstream.rb +0 -7
  24. data/lib/command/delete.rb +39 -7
  25. data/lib/command/deploy_image.rb +18 -3
  26. data/lib/command/exists.rb +1 -1
  27. data/lib/command/generate.rb +1 -1
  28. data/lib/command/info.rb +7 -3
  29. data/lib/command/logs.rb +22 -2
  30. data/lib/command/maintenance_off.rb +1 -1
  31. data/lib/command/maintenance_on.rb +1 -1
  32. data/lib/command/open.rb +2 -2
  33. data/lib/command/open_console.rb +2 -2
  34. data/lib/command/ps.rb +1 -1
  35. data/lib/command/ps_start.rb +2 -1
  36. data/lib/command/ps_stop.rb +40 -8
  37. data/lib/command/ps_wait.rb +3 -2
  38. data/lib/command/run.rb +430 -69
  39. data/lib/command/setup_app.rb +4 -1
  40. data/lib/constants/exit_code.rb +7 -0
  41. data/lib/core/config.rb +1 -1
  42. data/lib/core/controlplane.rb +109 -48
  43. data/lib/core/controlplane_api.rb +7 -1
  44. data/lib/core/controlplane_api_cli.rb +3 -3
  45. data/lib/core/controlplane_api_direct.rb +1 -1
  46. data/lib/core/shell.rb +15 -9
  47. data/lib/cpl/version.rb +1 -1
  48. data/lib/cpl.rb +48 -9
  49. data/lib/deprecated_commands.json +2 -1
  50. data/lib/generator_templates/controlplane.yml +2 -2
  51. data/script/check_cpln_links +3 -3
  52. data/templates/{gvc.yml → app.yml} +5 -0
  53. data/templates/secrets.yml +8 -0
  54. metadata +23 -26
  55. data/.rspec +0 -1
  56. data/lib/command/run_cleanup.rb +0 -116
  57. data/lib/command/run_detached.rb +0 -176
  58. data/lib/core/scripts.rb +0 -34
  59. data/templates/identity.yml +0 -3
  60. data/templates/secrets-policy.yml +0 -4
  61. /data/lib/generator_templates/templates/{gvc.yml → app.yml} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e67b960593def42983c0f333119e9edffe55434751769cb1ca25dd8333c1489
4
- data.tar.gz: 3f201ff14fe51d451c5ab1fd8705e5e544d5e99c87b83e53c54464841a835a1d
3
+ metadata.gz: 84efbe4c7082edcef9193b7a4116af57177b54f52373e4e4bca7e6b277f1b846
4
+ data.tar.gz: 9e047c8b354e6e0a01b28b84e4b3c74c0f5dd675c8d1f5113119803f1f5bcabb
5
5
  SHA512:
6
- metadata.gz: cb075c69a7fa151bdd800186594ef481999075c8377eabf7dcb886c0b30e246fcb5e3ccd6396ff0e8487ac5a8b50c24d01b3dade658cd7c2b4ebfa82cb6546c9
7
- data.tar.gz: 2a7c0782f57fd543f79fdeb985221dc72bfdba830bbfda81dc966e432007ad314ccd28ba299d0084d446993201f05cabaec40a133c0a2edf7b16af70f3e38348
6
+ metadata.gz: 6efc92fbcb3ea76e6ec44561178e719afc80af717790771b9c2c8358f564eb94b9c76b8aef8367c401e6e98f2faf9c0a8e628371a3193e038843339d12f7058e
7
+ data.tar.gz: e43668ec1adc98bd399396a35cb092d8d940df1d6bfea3ecb09b99e1be48f8ff7f0c625d8c4936eb61d01ceec4e3c8fb6a2eb7018f6ee91c1b0751dc7847f93f
@@ -16,7 +16,7 @@ jobs:
16
16
  - name: Set up Ruby
17
17
  uses: ruby/setup-ruby@v1
18
18
  with:
19
- ruby-version: "3.0"
19
+ ruby-version: "2.7"
20
20
  bundler-cache: true
21
21
  - name: Install dependencies
22
22
  run: bundle install
@@ -0,0 +1,56 @@
1
+ name: RSpec Shared
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ os-version:
7
+ required: true
8
+ type: string
9
+ ruby-version:
10
+ required: true
11
+ type: string
12
+ test-tag:
13
+ required: true
14
+ type: string
15
+
16
+ jobs:
17
+ rspec:
18
+ runs-on: ${{ inputs.os-version }}
19
+ env:
20
+ RAILS_ENV: test
21
+ # We have to add "_CI" to the end, otherwise it messes with tests where we switch profiles,
22
+ # as Control Plane will try to use this token's profile instead.
23
+ CPLN_TOKEN_CI: ${{ secrets.CPLN_TOKEN }}
24
+ CPLN_ORG: ${{ vars.CPLN_ORG }}
25
+ steps:
26
+ - name: Checkout code
27
+ uses: actions/checkout@v3
28
+ - name: Set up Ruby
29
+ uses: ruby/setup-ruby@v1
30
+ with:
31
+ ruby-version: ${{ inputs.ruby-version }}
32
+ bundler-cache: true
33
+ - name: Install dependencies
34
+ run: bundle install
35
+ - name: Install Control Plane tools
36
+ run: |
37
+ sudo npm install -g @controlplane/cli
38
+ cpln --version
39
+ - name: Setup Control Plane tools
40
+ run: |
41
+ cpln profile create default --token $CPLN_TOKEN_CI --org $CPLN_ORG
42
+ cpln image docker-login
43
+ - name: Run tests
44
+ run: bundle exec rspec --format documentation --tag ${{ inputs.test-tag }}
45
+ - name: Upload spec log
46
+ uses: actions/upload-artifact@master
47
+ if: always()
48
+ with:
49
+ name: spec-${{ inputs.test-tag }}-${{ github.run_id }}-${{ inputs.os-version }}-${{ inputs.ruby-version }}.log
50
+ path: spec.log
51
+ - name: Upload coverage results
52
+ uses: actions/upload-artifact@master
53
+ if: always()
54
+ with:
55
+ name: coverage-report-${{ inputs.test-tag }}-${{ github.run_id }}-${{ inputs.os-version }}-${{ inputs.ruby-version }}
56
+ path: coverage
@@ -5,36 +5,24 @@ on:
5
5
  branches:
6
6
  - main
7
7
  pull_request:
8
+ workflow_dispatch:
8
9
 
9
10
  jobs:
10
- rspec:
11
- strategy:
12
- matrix:
13
- os:
14
- - ubuntu-latest
15
- - macos-latest
16
- ruby:
17
- - "2.7"
18
- - "3.0"
19
- runs-on: ${{ matrix.os }}
20
- name: RSpec
21
- env:
22
- RAILS_ENV: test
23
- steps:
24
- - name: Checkout code
25
- uses: actions/checkout@v3
26
- - name: Set up Ruby
27
- uses: ruby/setup-ruby@v1
28
- with:
29
- ruby-version: ${{ matrix.ruby }}
30
- bundler-cache: true
31
- - name: Install dependencies
32
- run: bundle install
33
- - name: Run tests
34
- run: bundle exec rspec
35
- - name: Upload coverage results
36
- uses: actions/upload-artifact@master
37
- if: always()
38
- with:
39
- name: coverage-report-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.ruby }}
40
- path: coverage
11
+ rspec-fast:
12
+ name: RSpec (Fast)
13
+ uses: ./.github/workflows/rspec-shared.yml
14
+ with:
15
+ os-version: ubuntu-latest
16
+ ruby-version: "2.7"
17
+ test-tag: ~slow
18
+ secrets: inherit
19
+
20
+ rspec-slow:
21
+ name: RSpec (Slow)
22
+ uses: ./.github/workflows/rspec-shared.yml
23
+ if: github.event_name == 'workflow_dispatch'
24
+ with:
25
+ os-version: ubuntu-latest
26
+ ruby-version: "2.7"
27
+ test-tag: slow
28
+ secrets: inherit
@@ -8,15 +8,7 @@ on:
8
8
 
9
9
  jobs:
10
10
  rubocop:
11
- strategy:
12
- matrix:
13
- os:
14
- - ubuntu-latest
15
- - macos-latest
16
- ruby:
17
- - "2.7"
18
- - "3.0"
19
- runs-on: ${{ matrix.os }}
11
+ runs-on: ubuntu-latest
20
12
  name: Rubocop
21
13
  steps:
22
14
  - name: Checkout code
@@ -24,7 +16,7 @@ jobs:
24
16
  - name: Set up Ruby
25
17
  uses: ruby/setup-ruby@v1
26
18
  with:
27
- ruby-version: ${{ matrix.ruby }}
19
+ ruby-version: "2.7"
28
20
  bundler-cache: true
29
21
  - name: Install dependencies
30
22
  run: bundle install
data/.gitignore CHANGED
@@ -13,3 +13,5 @@
13
13
 
14
14
  # rspec failure tracking
15
15
  .rspec_status
16
+
17
+ spec.log
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "simplecov"
4
+
5
+ SimpleCov.start do
6
+ command_name "spawn"
7
+ enable_coverage :branch
8
+
9
+ at_fork.call(Process.pid)
10
+ end
data/CHANGELOG.md CHANGED
@@ -14,6 +14,14 @@ Changes since the last non-beta release.
14
14
 
15
15
  _Please add entries here for your pull requests that are not yet released._
16
16
 
17
+ ### Added
18
+
19
+ - Added option to set custom names for secrets and secrets policy, using `secrets_name` and `secrets_policy_name` in `controlplane.yml`. [PR 159](https://github.com/shakacode/heroku-to-control-plane/pull/159) by [Rafael Gomes](https://github.com/rafaelgomesxyz).
20
+
21
+ ### Changed
22
+
23
+ - `deploy-image` command now raises an error if image does not exist. [PR 153](https://github.com/shakacode/heroku-to-control-plane/pull/153) by [Rafael Gomes](https://github.com/rafaelgomesxyz).
24
+
17
25
  ## [1.4.0] - 2024-03-20
18
26
 
19
27
  ### Added
data/CONTRIBUTING.md CHANGED
@@ -12,13 +12,12 @@ git clone https://github.com/shakacode/heroku-to-control-plane
12
12
  alias cpl="~/projects/heroku-to-control-plane/bin/cpl"
13
13
  ```
14
14
 
15
- ## Linting/Testing
15
+ ## Linting
16
16
 
17
17
  Before committing or pushing code, be sure to:
18
18
 
19
19
  - Run `bundle exec rake update_command_docs` to sync any doc changes made in the source code to the docs
20
20
  - Run `bundle exec rubocop -a` to fix any linting errors
21
- - Run `bundle exec rspec` to run the test suite
22
21
 
23
22
  You can also install [overcommit](https://github.com/sds/overcommit) and let it automatically check for you:
24
23
 
@@ -28,6 +27,37 @@ gem install overcommit
28
27
  overcommit --install
29
28
  ```
30
29
 
30
+ ## Testing
31
+
32
+ We use real apps for the tests. You'll need to have full access to a Control Plane org, and then set it as the env var `CPLN_ORG` when running the tests (or in the `.env` file):
33
+
34
+ ```sh
35
+ CPLN_ORG=your-org-for-tests bundle exec rspec
36
+ ```
37
+
38
+ Alternatively, you might have a `.envrc` file with:
39
+
40
+ ```sh
41
+ export CPLN_ORG=shakacode-heroku-to-control-plane-ci
42
+ export RSPEC_RETRY_RETRY_COUNT=1
43
+ ```
44
+
45
+ Tests are separated between fast and slow. Slow tests can take a long time and usually involve building / deploying images and waiting for workloads to be ready / not ready, so they should only be run once in a while.
46
+
47
+ If you add a slow test, tag it with `slow`. Tests without a `slow` tag are considered fast by default.
48
+
49
+ To run fast tests:
50
+
51
+ ```sh
52
+ CPLN_ORG=your-org-for-tests bundle exec rspec --tag ~slow
53
+ ```
54
+
55
+ To run slow tests:
56
+
57
+ ```sh
58
+ CPLN_ORG=your-org-for-tests bundle exec rspec --tag slow
59
+ ```
60
+
31
61
  ## Debugging
32
62
 
33
63
  1. Use the `--verbose` option to see more detailed logs.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cpl (1.4.0)
4
+ cpl (2.0.0.rc.0)
5
5
  debug (~> 1.7.1)
6
6
  dotenv (~> 2.8.1)
7
7
  jwt (~> 2.8.1)
@@ -11,60 +11,66 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- addressable (2.8.4)
14
+ addressable (2.8.6)
15
15
  public_suffix (>= 2.0.2, < 6.0)
16
16
  ast (2.4.2)
17
17
  base64 (0.2.0)
18
+ bigdecimal (3.1.7)
18
19
  childprocess (4.1.0)
19
- crack (0.4.5)
20
+ crack (1.0.0)
21
+ bigdecimal
20
22
  rexml
21
23
  debug (1.7.2)
22
24
  irb (>= 1.5.0)
23
25
  reline (>= 0.3.1)
24
- diff-lcs (1.5.0)
26
+ diff-lcs (1.5.1)
25
27
  docile (1.4.0)
26
28
  dotenv (2.8.1)
27
- hashdiff (1.0.1)
29
+ hashdiff (1.1.0)
28
30
  iniparse (1.5.0)
29
31
  io-console (0.7.2)
30
- irb (1.12.0)
31
- rdoc
32
+ irb (1.13.1)
33
+ rdoc (>= 4.0.0)
32
34
  reline (>= 0.4.2)
33
- json (2.6.3)
35
+ json (2.7.2)
34
36
  jwt (2.8.1)
35
37
  base64
36
38
  overcommit (0.60.0)
37
39
  childprocess (>= 0.6.3, < 5)
38
40
  iniparse (~> 1.4)
39
41
  rexml (~> 3.2)
40
- parallel (1.22.1)
41
- parser (3.2.0.0)
42
+ parallel (1.24.0)
43
+ parser (3.3.0.5)
42
44
  ast (~> 2.4.1)
45
+ racc
43
46
  psych (5.1.2)
44
47
  stringio
45
- public_suffix (5.0.1)
48
+ public_suffix (5.0.5)
49
+ racc (1.7.3)
46
50
  rainbow (3.1.1)
47
- rake (13.0.6)
48
- rdoc (6.6.2)
51
+ rake (13.2.1)
52
+ rdoc (6.6.3.1)
49
53
  psych (>= 4.0.0)
50
- regexp_parser (2.6.2)
51
- reline (0.4.3)
54
+ regexp_parser (2.9.0)
55
+ reline (0.5.6)
52
56
  io-console (~> 0.5)
53
- rexml (3.2.5)
57
+ rexml (3.2.6)
54
58
  rspec (3.12.0)
55
59
  rspec-core (~> 3.12.0)
56
60
  rspec-expectations (~> 3.12.0)
57
61
  rspec-mocks (~> 3.12.0)
58
- rspec-core (3.12.1)
62
+ rspec-core (3.12.3)
59
63
  rspec-support (~> 3.12.0)
60
- rspec-expectations (3.12.2)
64
+ rspec-expectations (3.12.4)
61
65
  diff-lcs (>= 1.2.0, < 2.0)
62
66
  rspec-support (~> 3.12.0)
63
- rspec-mocks (3.12.3)
67
+ rspec-mocks (3.12.7)
64
68
  diff-lcs (>= 1.2.0, < 2.0)
65
69
  rspec-support (~> 3.12.0)
66
- rspec-support (3.12.0)
67
- rubocop (1.45.0)
70
+ rspec-retry (0.6.2)
71
+ rspec-core (> 3.3)
72
+ rspec-support (3.12.2)
73
+ rubocop (1.45.1)
68
74
  json (~> 2.3)
69
75
  parallel (~> 1.10)
70
76
  parser (>= 3.2.0.0)
@@ -74,16 +80,16 @@ GEM
74
80
  rubocop-ast (>= 1.24.1, < 2.0)
75
81
  ruby-progressbar (~> 1.7)
76
82
  unicode-display_width (>= 2.4.0, < 3.0)
77
- rubocop-ast (1.24.1)
78
- parser (>= 3.1.1.0)
79
- rubocop-capybara (2.17.0)
83
+ rubocop-ast (1.31.2)
84
+ parser (>= 3.3.0.4)
85
+ rubocop-capybara (2.20.0)
80
86
  rubocop (~> 1.41)
81
87
  rubocop-rake (0.6.0)
82
88
  rubocop (~> 1.0)
83
89
  rubocop-rspec (2.18.1)
84
90
  rubocop (~> 1.33)
85
91
  rubocop-capybara (~> 2.17)
86
- ruby-progressbar (1.11.0)
92
+ ruby-progressbar (1.13.0)
87
93
  simplecov (0.22.0)
88
94
  docile (~> 1.1)
89
95
  simplecov-html (~> 0.11)
@@ -92,9 +98,8 @@ GEM
92
98
  simplecov_json_formatter (0.1.4)
93
99
  stringio (3.1.0)
94
100
  thor (1.2.2)
95
- timecop (0.9.6)
96
- unicode-display_width (2.4.2)
97
- vcr (6.1.0)
101
+ timecop (0.9.8)
102
+ unicode-display_width (2.5.0)
98
103
  webmock (3.18.1)
99
104
  addressable (>= 2.8.0)
100
105
  crack (>= 0.3.2)
@@ -109,12 +114,12 @@ DEPENDENCIES
109
114
  overcommit (~> 0.60.0)
110
115
  rake (~> 13.0)
111
116
  rspec (~> 3.12.0)
117
+ rspec-retry (~> 0.6.2)
112
118
  rubocop (~> 1.45.0)
113
119
  rubocop-rake (~> 0.6.0)
114
120
  rubocop-rspec (~> 2.18.1)
115
121
  simplecov (~> 0.22.0)
116
122
  timecop (~> 0.9.6)
117
- vcr (~> 6.1.0)
118
123
  webmock (~> 3.18.1)
119
124
 
120
125
  BUNDLED WITH
data/README.md CHANGED
@@ -110,7 +110,7 @@ For the typical Rails app, this means:
110
110
 
111
111
  3. Install [Ruby](https://www.ruby-lang.org/en/) (required for these helpers).
112
112
 
113
- 4. Install Control Plane CLI, and configure access ([docs here](https://docs.controlplane.com/quickstart/quick-start-3-cli#getting-started-with-the-cli)).
113
+ 4. Install Control Plane CLI, and configure access ([docs here](https://shakadocs.controlplane.com/quickstart/quick-start-3-cli#getting-started-with-the-cli)).
114
114
 
115
115
  ```sh
116
116
  # Install CLI
@@ -125,7 +125,7 @@ npm update -g @controlplane/cli
125
125
 
126
126
  5. Run `cpln image docker-login --org <your-org>` to ensure that you have access to the Control Plane Docker registry.
127
127
 
128
- 6. Install Heroku to Control Plane `cpl` CLI as a [Ruby gem](https://rubygems.org/gems/cpl): `gem install cpl`. If you want to hack on the source code, see [CONTRIBUTING.md](CONTRIBUTING.md).
128
+ 6. Install Heroku to Control Plane `cpl` CLI as a [Ruby gem](https://rubygems.org/gems/cpl): `gem install cpl`. If you want to use `cpl` from Rake tasks in a Rails project, use `Bundler.with_unbundled_env { `cpl help` } or else you'll get an error that `cpl` cannot be found. While you can add `cpl` to your Gemfile, it's not recommended because it might trigger conflicts with other gems.
129
129
 
130
130
  7. You can use [this Dockerfile](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/.controlplane/Dockerfile) as an example for your project. Ensure that you have Docker running.
131
131
 
@@ -143,7 +143,7 @@ The `cpl` gem is based on several configuration files within a `/.controlplane`
143
143
  ```
144
144
  .controlplane/
145
145
  ├─ templates/
146
- │ ├─ gvc.yml
146
+ │ ├─ app.yml
147
147
  │ ├─ postgres.yml
148
148
  │ ├─ rails.yml
149
149
  ├─ controlplane.yml
@@ -154,8 +154,8 @@ The `cpl` gem is based on several configuration files within a `/.controlplane`
154
154
  1. `controlplane.yml` describes the overall application. Be sure to have `<your-org>` as the value for `aliases.common.cpln_org`, or set it with the `CPLN_ORG` environment variable.
155
155
  2. `Dockerfile` builds the production application. `entrypoint.sh` is an _example_ entrypoint script for the production application, referenced in your Dockerfile.
156
156
  3. `templates` directory contains the templates for the various workloads, such as `rails.yml` and `postgres.yml`.
157
- 4. `templates/gvc.yml` defines your project's GVC (like a Heroku app). More importantly, it contains ENV values for the app.
158
- 5. `templates/rails.yml` defines your Rails workload. It may inherit ENV values from the parent GVC, which is populated from the `templates/gvc.yml`. This file also configures scaling, sizing, firewalls, and other workload-specific values.
157
+ 4. `templates/app.yml` defines your project's GVC (like a Heroku app). More importantly, it contains ENV values for the app.
158
+ 5. `templates/rails.yml` defines your Rails workload. It may inherit ENV values from the parent GVC, which is populated from the `templates/app.yml`. This file also configures scaling, sizing, firewalls, and other workload-specific values.
159
159
  6. For other workloads (like lines in a Heroku `Procfile`), you create additional template files. For example, you can base a `templates/sidekiq.yml` on the `templates/rails.yml` file.
160
160
  7. You can have other files in the `templates` directory, such as `redis.yml` and `postgres.yml`, which could setup Redis and Postgres for a testing application.
161
161
 
@@ -183,39 +183,52 @@ aliases:
183
183
 
184
184
  # Control Plane offers the ability to use multiple locations.
185
185
  # default_location is used for commands that require a location
186
- # including `ps`, `run`, `run:detached`, `apply-template`.
186
+ # including `ps`, `run`, `apply-template`.
187
187
  # This can be overridden with option --location=<location> and
188
188
  # CPLN_LOCATION environment variable.
189
189
  default_location: aws-us-east-2
190
190
 
191
191
  # Allows running the command `cpl setup-app`
192
- # instead of `cpl apply-template gvc redis postgres memcached rails sidekiq`.
192
+ # instead of `cpl apply-template app redis postgres memcached rails sidekiq`.
193
193
  #
194
194
  # Note:
195
195
  # 1. These names correspond to files in the `./controlplane/templates` directory.
196
196
  # 2. Each file can contain many objects, such as in the case of templates that create a resource, like `postgres`.
197
197
  # 3. While the naming often corresponds to a workload or other object name, the naming is arbitrary.
198
198
  # Naming does not need to match anything other than the file name without the `.yml` extension.
199
+ #
200
+ # If you're going to use secrets, you need to apply the `secrets.yml` template separately (one-time setup):
201
+ # `cpl apply-template secrets -a my-app`
199
202
  setup_app_templates:
200
- - gvc
201
-
202
- # These templates are only required if using secrets.
203
- - identity
204
- - secrets
205
- - secrets-policy
206
-
203
+ - app
207
204
  - redis
208
205
  - postgres
209
206
  - memcached
210
207
  - rails
211
208
  - sidekiq
212
209
 
210
+ # Only needed if using a custom secrets name.
211
+ # The default is '{APP_PREFIX}-secrets'. For example:
212
+ # - for an app 'my-app-staging' with `match_if_app_name_starts_with` set to `false`,
213
+ # it would be 'my-app-staging-secrets'
214
+ # - for an app 'my-app-review-1234' with `match_if_app_name_starts_with` set to `true`,
215
+ # it would be 'my-app-review-secrets'
216
+ secrets_name: my-secrets
217
+
218
+ # Only needed if using a custom secrets policy name.
219
+ # The default is '{APP_SECRETS}-policy'. For example:
220
+ # - for an app 'my-app-staging' with `match_if_app_name_starts_with` set to `false`,
221
+ # it would be 'my-app-staging-secrets-policy'
222
+ # - for an app 'my-app-review-1234' with `match_if_app_name_starts_with` set to `true`,
223
+ # it would be 'my-app-review-secrets-policy'
224
+ secrets_policy_name: my-secrets-policy
225
+
213
226
  # Configure the workload name used as a template for one-off scripts, like a Heroku one-off dyno.
214
227
  one_off_workload: rails
215
228
 
216
229
  # Workloads that are for the application itself and are using application Docker images.
217
230
  # These are updated with the new image when running the `deploy-image` command,
218
- # and are also used by the `info`, `ps:`, and `run:cleanup` commands in order to get all of the defined workloads.
231
+ # and are also used by the `info` and `ps:` commands in order to get all of the defined workloads.
219
232
  # On the other hand, if you have a workload for Redis, that would NOT use the application Docker image
220
233
  # and not be listed here.
221
234
  app_workloads:
@@ -223,7 +236,7 @@ aliases:
223
236
  - sidekiq
224
237
 
225
238
  # Additional "service type" workloads, using non-application Docker images.
226
- # These are only used by the `info`, `ps:` and `run:cleanup` commands in order to get all of the defined workloads.
239
+ # These are only used by the `info` and `ps:` commands in order to get all of the defined workloads.
227
240
  additional_workloads:
228
241
  - redis
229
242
  - postgres
@@ -233,7 +246,7 @@ aliases:
233
246
  maintenance_workload: maintenance
234
247
 
235
248
  # Fixes the remote terminal size to match the local terminal size
236
- # when running the commands `cpl run` or `cpl run:detached`.
249
+ # when running `cpl run`.
237
250
  fix_terminal_size: true
238
251
 
239
252
  # Apps with a deployed image created before this amount of days will be listed for deletion
@@ -248,10 +261,6 @@ aliases:
248
261
  # when running the command `cpl cleanup-images` (`image_retention_max_qty` takes precedence).
249
262
  image_retention_days: 5
250
263
 
251
- # Run workloads created before this amount of days will be listed for deletion
252
- # when running the command `cpl run:cleanup`.
253
- stale_run_workload_created_days: 2
254
-
255
264
  apps:
256
265
  my-app-staging:
257
266
  # Use the values from the common section above.
@@ -307,7 +316,7 @@ Suppose your app is called `tutorial-app`. You can run the following commands.
307
316
  ```sh
308
317
  # Provision all infrastructure on Control Plane.
309
318
  # `tutorial-app` will be created per definition in .controlplane/controlplane.yml.
310
- cpl apply-template gvc postgres redis rails daily-task -a tutorial-app
319
+ cpl apply-template app postgres redis rails daily-task -a tutorial-app
311
320
 
312
321
  # Build and push the Docker image to the Control Plane repository.
313
322
  # Note, it may take many minutes. Be patient.
@@ -336,7 +345,7 @@ cpl build-image -a tutorial-app
336
345
  # Run database migrations (or other release tasks) with the latest image,
337
346
  # while the app is still running on the previous image.
338
347
  # This is analogous to the release phase.
339
- cpl run:detached rails db:migrate -a tutorial-app --image latest
348
+ cpl run -a tutorial-app --image latest -- rails db:migrate
340
349
 
341
350
  # Pomote the latest image to the app.
342
351
  cpl deploy-image -a tutorial-app
@@ -374,7 +383,7 @@ It is also possible to set up a Secret store (of type `Dictionary`), which we ca
374
383
  `cpln://secret/MY_SECRET_STORE_NAME/MY_SECRET_VAR_NAME`. In such a case, we must set up an app Identity and proper
375
384
  Policy to access the secret.
376
385
 
377
- In `templates/gvc.yml`:
386
+ In `templates/app.yml`:
378
387
 
379
388
  ```yaml
380
389
  spec:
@@ -446,7 +455,7 @@ development purposes.
446
455
 
447
456
  ## Scheduled Jobs
448
457
 
449
- Control Plane supports scheduled jobs via [cron workloads](https://docs.controlplane.com/reference/workload#cron).
458
+ Control Plane supports scheduled jobs via [cron workloads](https://shakadocs.controlplane.com/reference/workload#cron).
450
459
 
451
460
  Here's a partial example of a template for a cron workload, using the app image:
452
461
 
data/cpl.gemspec CHANGED
@@ -23,12 +23,12 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_development_dependency "overcommit", "~> 0.60.0"
25
25
  spec.add_development_dependency "rspec", "~> 3.12.0"
26
+ spec.add_development_dependency "rspec-retry", "~> 0.6.2"
26
27
  spec.add_development_dependency "rubocop", "~> 1.45.0"
27
28
  spec.add_development_dependency "rubocop-rake", "~> 0.6.0"
28
29
  spec.add_development_dependency "rubocop-rspec", "~> 2.18.1"
29
30
  spec.add_development_dependency "simplecov", "~> 0.22.0"
30
31
  spec.add_development_dependency "timecop", "~> 0.9.6"
31
- spec.add_development_dependency "vcr", "~> 6.1.0"
32
32
  spec.add_development_dependency "webmock", "~> 3.18.1"
33
33
 
34
34
  spec.files = `git ls-files -z`.split("\x0").reject do |file|