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
data/docs/commands.md CHANGED
@@ -36,7 +36,7 @@ This `-a` option is used in most of the commands and will pick all other app con
36
36
  cpl apply-template redis -a $APP_NAME
37
37
 
38
38
  # Applies several templates (practically creating full app).
39
- cpl apply-template gvc postgres redis rails -a $APP_NAME
39
+ cpl apply-template app postgres redis rails -a $APP_NAME
40
40
  ```
41
41
 
42
42
  ### `build-image`
@@ -105,17 +105,22 @@ cpl copy-image-from-upstream -a $APP_NAME --upstream-token $UPSTREAM_TOKEN --ima
105
105
 
106
106
  ### `delete`
107
107
 
108
- - Deletes the whole app (GVC with all workloads, all volumesets and all images)
108
+ - Deletes the whole app (GVC with all workloads, all volumesets and all images) or a specific workload
109
109
  - Will ask for explicit user confirmation
110
110
 
111
111
  ```sh
112
+ # Deletes the whole app (GVC with all workloads, all volumesets and all images).
112
113
  cpl delete -a $APP_NAME
114
+
115
+ # Deletes a specific workload.
116
+ cpl delete -a $APP_NAME -w $WORKLOAD_NAME
113
117
  ```
114
118
 
115
119
  ### `deploy-image`
116
120
 
117
121
  - Deploys the latest image to app workloads
118
122
  - Optionally runs a release script before deploying if specified through `release_script` in the `.controlplane/controlplane.yml` file and `--run-release-phase` is provided
123
+ - The release script is run in the context of `cpl run` with the latest image
119
124
  - The deploy will fail if the release script exits with a non-zero code or doesn't exist
120
125
 
121
126
  ```sh
@@ -177,6 +182,7 @@ cpl latest-image -a $APP_NAME
177
182
  ### `logs`
178
183
 
179
184
  - Light wrapper to display tailed raw logs for app/workload syntax
185
+ - Defaults to showing the last 200 entries from the past 1 hour before tailing
180
186
 
181
187
  ```sh
182
188
  # Displays logs for the default workload (`one_off_workload`).
@@ -184,6 +190,15 @@ cpl logs -a $APP_NAME
184
190
 
185
191
  # Displays logs for a specific workload.
186
192
  cpl logs -a $APP_NAME -w $WORKLOAD_NAME
193
+
194
+ # Displays logs for a specific replica of a workload.
195
+ cpl logs -a $APP_NAME -w $WORKLOAD_NAME -r $REPLICA_NAME
196
+
197
+ # Uses a different limit on number of entries.
198
+ cpl logs -a $APP_NAME --limit 100
199
+
200
+ # Uses a different loopback window.
201
+ cpl logs -a $APP_NAME --since 30min
187
202
  ```
188
203
 
189
204
  ### `maintenance`
@@ -311,6 +326,9 @@ cpl ps:stop -a $APP_NAME
311
326
 
312
327
  # Stops a specific workload in app.
313
328
  cpl ps:stop -a $APP_NAME -w $WORKLOAD_NAME
329
+
330
+ # Stops a specific replica of a workload.
331
+ cpl ps:stop -a $APP_NAME -w $WORKLOAD_NAME -r $REPLICA_NAME
314
332
  ```
315
333
 
316
334
  ### `ps:wait`
@@ -327,26 +345,43 @@ cpl ps:swait -a $APP_NAME -w $WORKLOAD_NAME
327
345
 
328
346
  ### `run`
329
347
 
330
- - Runs one-off **_interactive_** replicas (analog of `heroku run`)
331
- - Uses `Standard` workload type and `cpln exec` as the execution method, with CLI streaming
332
- - If `fix_terminal_size` is `true` in the `.controlplane/controlplane.yml` file, the remote terminal size will be fixed to match the local terminal size (may also be overriden through `--terminal-size`)
333
-
334
- > **IMPORTANT:** Useful for development where it's needed for interaction, and where network connection drops and
335
- > task crashing are tolerable. For production tasks, it's better to use `cpl run:detached`.
348
+ - Runs one-off interactive or non-interactive replicas (analog of `heroku run`)
349
+ - Uses `Cron` workload type and either:
350
+ - - `cpln workload exec` for interactive mode, with CLI streaming
351
+ - - log async fetching for non-interactive mode
352
+ - The Dockerfile entrypoint is used as the command by default, which assumes `exec "${@}"` to be present,
353
+ and the args ["bash", "-c", cmd_to_run] are passed
354
+ - The entrypoint can be overriden through `--entrypoint`, which must be a single command or a script path that exists in the container,
355
+ and the args ["bash", "-c", cmd_to_run] are passed,
356
+ unless the entrypoint is `bash`, in which case the args ["-c", cmd_to_run] are passed
357
+ - Providing `--entrypoint none` sets the entrypoint to `bash` by default
358
+ - If `fix_terminal_size` is `true` in the `.controlplane/controlplane.yml` file,
359
+ the remote terminal size will be fixed to match the local terminal size (may also be overriden through `--terminal-size`)
336
360
 
337
361
  ```sh
338
362
  # Opens shell (bash by default).
339
363
  cpl run -a $APP_NAME
340
364
 
341
- # Need to quote COMMAND if setting ENV value or passing args.
342
- cpl run -a $APP_NAME -- 'LOG_LEVEL=warn rails db:migrate'
365
+ # Runs interactive command, keeps shell open, and stops job when exiting.
366
+ cpl run -a $APP_NAME --interactive -- rails c
343
367
 
344
- # Runs command, displays output, and exits shell.
345
- cpl run -a $APP_NAME -- ls /
346
- cpl run -a $APP_NAME -- rails db:migrate:status
368
+ # Some commands are automatically detected as interactive, so no need to pass `--interactive`.
369
+ cpl run -a $APP_NAME -- bash
370
+ cpl run -a $APP_NAME -- rails console
371
+ cpl run -a $APP_NAME -- rails c
372
+ cpl run -a $APP_NAME -- rails dbconsole
373
+ cpl run -a $APP_NAME -- rails db
347
374
 
348
- # Runs command and keeps shell open.
349
- cpl run -a $APP_NAME -- rails c
375
+ # Runs non-interactive command, outputs logs, exits with the exit code of the command and stops job.
376
+ cpl run -a $APP_NAME -- rails db:migrate
377
+
378
+ # Runs non-iteractive command, detaches, exits with 0, and prints commands to:
379
+ # - see logs from the job
380
+ # - stop the job
381
+ cpl run -a $APP_NAME --detached -- rails db:migrate
382
+
383
+ # The command needs to be quoted if setting an env variable or passing args.
384
+ cpl run -a $APP_NAME -- 'SOME_ENV_VAR=some_value rails db:migrate'
350
385
 
351
386
  # Uses a different image (which may not be promoted yet).
352
387
  cpl run -a $APP_NAME --image appimage:123 -- rails db:migrate # Exact image name
@@ -358,47 +393,12 @@ cpl run -a $APP_NAME -w other-workload -- bash
358
393
  # Overrides remote CPLN_TOKEN env variable with local token.
359
394
  # Useful when superuser rights are needed in remote container.
360
395
  cpl run -a $APP_NAME --use-local-token -- bash
361
- ```
362
-
363
- ### `run:cleanup`
364
-
365
- - Deletes stale run workloads for an app
366
- - Workloads are considered stale based on how many days since created
367
- - `stale_run_workload_created_days` in the `.controlplane/controlplane.yml` file specifies the number of days after created that the workload is considered stale
368
- - Works for both interactive workloads (created with `cpl run`) and non-interactive workloads (created with `cpl run:detached`)
369
- - Will ask for explicit user confirmation of deletion
370
-
371
- ```sh
372
- cpl run:cleanup -a $APP_NAME
373
- ```
374
-
375
- ### `run:detached`
376
-
377
- - Runs one-off **_non-interactive_** replicas (close analog of `heroku run:detached`)
378
- - Uses `Cron` workload type with log async fetching
379
- - Implemented with only async execution methods, more suitable for production tasks
380
- - Has alternative log fetch implementation with only JSON-polling and no WebSockets
381
- - Less responsive but more stable, useful for CI tasks
382
- - Deletes the workload whenever finished with success
383
- - Deletes the workload whenever finished with failure by default
384
- - Use `--no-clean-on-failure` to disable cleanup to help with debugging failed runs
385
-
386
- ```sh
387
- cpl run:detached rails db:prepare -a $APP_NAME
388
396
 
389
- # Need to quote COMMAND if setting ENV value or passing args.
390
- cpl run:detached -a $APP_NAME -- 'LOG_LEVEL=warn rails db:migrate'
397
+ # Replaces the existing Dockerfile entrypoint with `bash`.
398
+ cpl run -a $APP_NAME --entrypoint none -- rails db:migrate
391
399
 
392
- # Uses a different image (which may not be promoted yet).
393
- cpl run:detached -a $APP_NAME --image appimage:123 -- rails db:migrate # Exact image name
394
- cpl run:detached -a $APP_NAME --image latest -- rails db:migrate # Latest sequential image
395
-
396
- # Uses a different workload than `one_off_workload` from `.controlplane/controlplane.yml`.
397
- cpl run:detached -a $APP_NAME -w other-workload -- rails db:migrate:status
398
-
399
- # Overrides remote CPLN_TOKEN env variable with local token.
400
- # Useful when superuser rights are needed in remote container.
401
- cpl run:detached -a $APP_NAME --use-local-token -- rails db:migrate:status
400
+ # Replaces the existing Dockerfile entrypoint.
401
+ cpl run -a $APP_NAME --entrypoint /app/alternative-entrypoint.sh -- rails db:migrate
402
402
  ```
403
403
 
404
404
  ### `setup-app`
data/docs/dns.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # DNS Setup Example
2
2
 
3
+ ## Docs
4
+
5
+ https://shakadocs.controlplane.com/guides/configure-domain#dns-records
6
+
7
+ ## Example
8
+
3
9
  About reactrails.com DNS, steps:
4
10
  1. create CNAME or ALIAS record pointing to rails-xxxx.cpln.app
5
11
  1. go to CPLN Domains -> create
data/docs/migrating.md CHANGED
@@ -36,7 +36,7 @@ key, e.g.:
36
36
  my-app-staging:
37
37
  <<: *common
38
38
  setup_app_templates:
39
- - gvc
39
+ - app
40
40
  - redis
41
41
  - memcached
42
42
  - rails
@@ -46,8 +46,8 @@ my-app-staging:
46
46
  Note how the templates correspond to files in the `.controlplane/templates/` directory. These files will be used by the
47
47
  `cpl setup-app` and `cpl apply-template` commands.
48
48
 
49
- Ensure that env vars point to the Heroku add-ons in the template for the app (`.controlplane/templates/gvc.yml`). See
50
- [this example](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/.controlplane/templates/gvc.yml).
49
+ Ensure that env vars point to the Heroku add-ons in the template for the app (`.controlplane/templates/app.yml`). See
50
+ [this example](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/.controlplane/templates/app.yml).
51
51
 
52
52
  After that, create a Dockerfile in `.controlplane/Dockerfile` for your deployment. See
53
53
  [this example](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/.controlplane/Dockerfile).
@@ -61,7 +61,7 @@ app_main_folder/
61
61
  controlplane.yml
62
62
  entrypoint.sh # App-specific - edit as needed.
63
63
  templates/
64
- gvc.yml
64
+ app.yml
65
65
  memcached.yml
66
66
  rails.yml
67
67
  redis.yml
@@ -93,7 +93,7 @@ cpl setup-app -a my-app-staging
93
93
  cpl build-image -a my-app-staging --commit 456
94
94
 
95
95
  # Prepare database.
96
- cpl run:detached -a my-app-staging --image latest -- rails db:prepare
96
+ cpl run -a my-app-staging --image latest -- rails db:prepare
97
97
 
98
98
  # Deploy latest image.
99
99
  cpl deploy-image -a my-app-staging
@@ -113,7 +113,7 @@ cpl build-image -a my-app-staging --commit ABC
113
113
 
114
114
  # Run database migrations (or other release tasks) with latest image, while app is still running on previous image.
115
115
  # This is analogous to the release phase.
116
- cpl run:detached -a my-app-staging --image latest -- rails db:migrate
116
+ cpl run -a my-app-staging --image latest -- rails db:migrate
117
117
 
118
118
  # Deploy latest image.
119
119
  cpl deploy-image -a my-app-staging
@@ -192,7 +192,7 @@ configure an entry for, e.g., `my-app-review`, and then create review apps start
192
192
  <<: *common
193
193
  match_if_app_name_starts_with: true
194
194
  setup_app_templates:
195
- - gvc
195
+ - app
196
196
  - redis
197
197
  - memcached
198
198
  - rails
@@ -215,9 +215,9 @@ fi
215
215
 
216
216
  # The `NEW_APP` env var that we exported above can be used to either reset or migrate the database before deploying.
217
217
  if [ -n "${NEW_APP}" ]; then
218
- cpl run:detached 'LOG_LEVEL=warn rails db:reset' -a ${APP_NAME} --image latest
218
+ cpl run -a ${APP_NAME} --image latest -- rails db:reset
219
219
  else
220
- cpl run:detached 'LOG_LEVEL=warn rails db:migrate_and_wait_replica' -a ${APP_NAME} --image latest
220
+ cpl run -a ${APP_NAME} --image latest -- rails db:migrate
221
221
  fi
222
222
  ```
223
223
 
@@ -226,7 +226,7 @@ Then follow the same steps for the initial deployment or code upgrades.
226
226
  ### Database for Review Apps
227
227
 
228
228
  For the review app resources, these should be handled as env vars in the template for the app
229
- (`.controlplane/templates/gvc.yml`), .e.g.:
229
+ (`.controlplane/templates/app.yml`), .e.g.:
230
230
 
231
231
  ```yaml
232
232
  - name: DATABASE_URL
data/docs/tips.md CHANGED
@@ -65,7 +65,7 @@ The actual remote IP of the workload container is in the 127.0.0.x network, so t
65
65
  `REMOTE_ADDR` env var.
66
66
 
67
67
  However, Control Plane additionally sets the `x-forwarded-for` and `x-envoy-external-address` headers (and others - see:
68
- https://docs.controlplane.com/concepts/security#headers). On Rails, the `ActionDispatch::RemoteIp` middleware should
68
+ https://shakadocs.controlplane.com/concepts/security#headers). On Rails, the `ActionDispatch::RemoteIp` middleware should
69
69
  pick those up and automatically populate `request.remote_ip`.
70
70
 
71
71
  So `REMOTE_ADDR` should not be used directly, only `request.remote_ip`.
@@ -87,17 +87,19 @@ level, which applies to your GVCs mapped to that org.
87
87
 
88
88
  You can do this during the initial app setup, like this:
89
89
 
90
- 1. Add the templates for `identity`, `secrets` and `secrets-policy` to `.controlplane/templates`
91
- 2. Ensure that the templates are listed in `setup_app_templates` for the app in `.controlplane/controlplane.yml`
92
- 3. Run `cpl setup-app -a $APP_NAME`
93
- 4. The identity, secrets and secrets policy will be automatically created, along with the proper binding
94
- 5. In the upper left "Manage Org" menu, click on "Secrets"
95
- 6. Find the created secret (it will be in the `$APP_PREFIX-secrets` format) and add the secret env vars there
96
- 7. Use `cpln://secret/...` in the app to access the secret env vars (e.g., `cpln://secret/$APP_PREFIX-secrets.SOME_VAR`)
90
+ 1. Add the templates for `app` and `secrets` to `.controlplane/templates`
91
+ 2. Ensure that the `app` template includes the `identity`
92
+ 3. Ensure that the `app` template is listed in `setup_app_templates` for the app in `.controlplane/controlplane.yml`
93
+ 4. Run `cpl apply-template secrets -a $APP_NAME` (one-time setup)
94
+ 5. Run `cpl setup-app -a $APP_NAME`
95
+ 6. The secrets, secrets policy and identity will be automatically created, along with the proper binding
96
+ 7. In the Control Plane console, upper left "Manage Org" menu, click on "Secrets"
97
+ 8. Find the created secret (it will be in the `$APP_PREFIX-secrets` format) and add the secret env vars there
98
+ 9. Use `cpln://secret/...` in the app to access the secret env vars (e.g., `cpln://secret/$APP_PREFIX-secrets.SOME_VAR`)
97
99
 
98
- You can also do it manually after. Here is how you do this:
100
+ Here are the manual steps for reference. We recommend that you follow the steps above:
99
101
 
100
- 1. In the upper left "Manage Org" menu, click on "Secrets"
102
+ 1. In the upper left of the Control Plane console, "Manage Org" menu, click on "Secrets"
101
103
  2. Create a secret with `Secret Type: Dictionary` (e.g., `my-secrets`) and add the secret env vars there
102
104
  3. In the upper left "Manage GVC" menu, click on "Identities"
103
105
  4. Create an identity (e.g., `my-identity`)
@@ -27,7 +27,7 @@ build-staging:
27
27
  command: cpl build-image -a ${APP_NAME}
28
28
  - run:
29
29
  name: Database tasks
30
- command: cpl run:detached -a ${APP_NAME} --image latest -- rails db:migrate
30
+ command: cpl run -a ${APP_NAME} --image latest -- rails db:migrate
31
31
  - run:
32
32
  name: Deploy image
33
33
  command: cpl deploy-image -a ${APP_NAME}
@@ -75,9 +75,9 @@ build-review-app:
75
75
  name: Database tasks
76
76
  command: |
77
77
  if [ -n "${NEW_APP}" ]; then
78
- cpl run:detached -a ${APP_NAME} --image latest -- LOG_LEVEL=warn rails db:reset
78
+ cpl run -a ${APP_NAME} --image latest -- rails db:reset
79
79
  else
80
- cpl run:detached -a ${APP_NAME} --image latest -- LOG_LEVEL=warn rails db:migrate
80
+ cpl run -a ${APP_NAME} --image latest -- rails db:migrate
81
81
  fi
82
82
  - run:
83
83
  name: Deploy image
@@ -17,40 +17,53 @@ aliases:
17
17
 
18
18
  # Control Plane offers the ability to use multiple locations.
19
19
  # default_location is used for commands that require a location
20
- # including `ps`, `run`, `run:detached`, `apply-template`.
20
+ # including `ps`, `run`, `apply-template`.
21
21
  # This can be overridden with option --location=<location> and
22
22
  # CPLN_LOCATION environment variable.
23
23
  # TODO: Allow specification of multiple locations.
24
24
  default_location: aws-us-east-2
25
25
 
26
26
  # Allows running the command `cpl setup-app`
27
- # instead of `cpl apply-template gvc redis postgres memcached rails sidekiq`.
27
+ # instead of `cpl apply-template app redis postgres memcached rails sidekiq`.
28
28
  #
29
29
  # Note:
30
30
  # 1. These names correspond to files in the `./controlplane/templates` directory.
31
31
  # 2. Each file can contain many objects, such as in the case of templates that create a resource, like `postgres`.
32
32
  # 3. While the naming often corresponds to a workload or other object name, the naming is arbitrary.
33
33
  # Naming does not need to match anything other than the file name without the `.yml` extension.
34
+ #
35
+ # If you're going to use secrets, you need to apply the `secrets.yml` template separately (one-time setup):
36
+ # `cpl apply-template secrets -a my-app`
34
37
  setup_app_templates:
35
- - gvc
36
-
37
- # These templates are only required if using secrets.
38
- - identity
39
- - secrets
40
- - secrets-policy
41
-
38
+ - app
42
39
  - redis
43
40
  - postgres
44
41
  - memcached
45
42
  - rails
46
43
  - sidekiq
47
44
 
45
+ # Only needed if using a custom secrets name.
46
+ # The default is '{APP_PREFIX}-secrets'. For example:
47
+ # - for an app 'my-app-staging' with `match_if_app_name_starts_with` set to `false`,
48
+ # it would be 'my-app-staging-secrets'
49
+ # - for an app 'my-app-review-1234' with `match_if_app_name_starts_with` set to `true`,
50
+ # it would be 'my-app-review-secrets'
51
+ secrets_name: my-secrets
52
+
53
+ # Only needed if using a custom secrets policy name.
54
+ # The default is '{APP_SECRETS}-policy'. For example:
55
+ # - for an app 'my-app-staging' with `match_if_app_name_starts_with` set to `false`,
56
+ # it would be 'my-app-staging-secrets-policy'
57
+ # - for an app 'my-app-review-1234' with `match_if_app_name_starts_with` set to `true`,
58
+ # it would be 'my-app-review-secrets-policy'
59
+ secrets_policy_name: my-secrets-policy
60
+
48
61
  # Configure the workload name used as a template for one-off scripts, like a Heroku one-off dyno.
49
62
  one_off_workload: rails
50
63
 
51
64
  # Workloads that are for the application itself and are using application Docker images.
52
65
  # These are updated with the new image when running the `deploy-image` command,
53
- # and are also used by the `info`, `ps:`, and `run:cleanup` commands in order to get all of the defined workloads.
66
+ # and are also used by the `info` and `ps:` commands in order to get all of the defined workloads.
54
67
  # On the other hand, if you have a workload for Redis, that would NOT use the application Docker image
55
68
  # and not be listed here.
56
69
  app_workloads:
@@ -58,7 +71,7 @@ aliases:
58
71
  - sidekiq
59
72
 
60
73
  # Additional "service type" workloads, using non-application Docker images.
61
- # These are only used by the `info`, `ps:` and `run:cleanup` commands in order to get all of the defined workloads.
74
+ # These are only used by the `info` and `ps:` commands in order to get all of the defined workloads.
62
75
  additional_workloads:
63
76
  - redis
64
77
  - postgres
@@ -68,7 +81,7 @@ aliases:
68
81
  maintenance_workload: maintenance
69
82
 
70
83
  # Fixes the remote terminal size to match the local terminal size
71
- # when running the commands `cpl run` or `cpl run:detached`.
84
+ # when running `cpl run`.
72
85
  fix_terminal_size: true
73
86
 
74
87
  # Apps with a deployed image created before this amount of days will be listed for deletion
@@ -83,10 +96,6 @@ aliases:
83
96
  # when running the command `cpl cleanup-images` (`image_retention_max_qty` takes precedence).
84
97
  image_retention_days: 5
85
98
 
86
- # Run workloads created before this amount of days will be listed for deletion
87
- # when running the command `cpl run:cleanup`.
88
- stale_run_workload_created_days: 2
89
-
90
99
  apps:
91
100
  my-app-staging:
92
101
  # Use the values from the common section above.
@@ -36,7 +36,7 @@ module Command
36
36
  cpl apply-template redis -a $APP_NAME
37
37
 
38
38
  # Applies several templates (practically creating full app).
39
- cpl apply-template gvc postgres redis rails -a $APP_NAME
39
+ cpl apply-template app postgres redis rails -a $APP_NAME
40
40
  ```
41
41
  EX
42
42
 
@@ -50,7 +50,7 @@ module Command
50
50
  @asked_for_confirmation = false
51
51
 
52
52
  pending_templates = templates.select do |template|
53
- if template == "gvc"
53
+ if template == "app"
54
54
  confirm_app(template)
55
55
  else
56
56
  confirm_workload(template)
@@ -64,15 +64,15 @@ module Command
64
64
  pending_templates.each do |template, filename|
65
65
  step("Applying template '#{template}'", abort_on_error: false) do
66
66
  items = apply_template(filename)
67
- if items
68
- items.each do |item|
69
- report_success(item)
70
- end
71
- else
67
+ unless items
72
68
  report_failure(template)
69
+ next false
73
70
  end
74
71
 
75
- $CHILD_STATUS.success?
72
+ items.each do |item|
73
+ report_success(item)
74
+ end
75
+ true
76
76
  end
77
77
  end
78
78
 
@@ -82,7 +82,7 @@ module Command
82
82
  print_failed_templates
83
83
  print_skipped_templates
84
84
 
85
- exit(1) if @failed_templates.any?
85
+ exit(ExitCode::ERROR_DEFAULT) if @failed_templates.any?
86
86
  end
87
87
 
88
88
  private