Skip to content

Commit

Permalink
Rename 'setup' to 'setup_app_templates' in config file (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangarha authored Dec 1, 2023
1 parent 43ef1be commit ab7b8d3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ _Please add entries here for your pull requests that are not yet released._
### Changed

- `--org` option now takes precedence over `CPLN_ORG` env var, which takes precedence over `cpln_org` from `controlplane.yml`. [PR 88](https://github.com/shakacode/heroku-to-control-plane/pull/88) by [Rafael Gomes](https://github.com/rafaelgomesxyz).
- Renamed `setup` config into `setup_app_templates`. [PR 112](https://github.com/shakacode/heroku-to-control-plane/pull/112) by [Mostafa Ahangarhga](https://github.com/ahangarha).

## [1.1.2] - 2023-10-17

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ aliases:

# Allows running the command `cpl setup-app`
# instead of `cpl apply-template gvc redis postgres memcached rails sidekiq`.
setup:
setup_app_templates:
- gvc
- redis
- postgres
Expand Down
4 changes: 2 additions & 2 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ cpl run:detached rails db:migrate:status -a $APP_NAME --use-local-token
### `setup-app`
- Creates an app and all its workloads
- Specify the templates for the app and workloads through `setup` in the `.controlplane/controlplane.yml` file
- This should should only be used for temporary apps like review apps, never for persistent apps like production (to update workloads for those, use 'cpl apply-template' instead)
- Specify the templates for the app and workloads through `setup_app_templates` in the `.controlplane/controlplane.yml` file
- This should only be used for temporary apps like review apps, never for persistent apps like production (to update workloads for those, use 'cpl apply-template' instead)
```sh
cpl setup-app -a $APP_NAME
Expand Down
6 changes: 3 additions & 3 deletions docs/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ Edit the `.controlplane/controlplane.yml` file as needed. Note that the `my-app-
is defined in this file. See
[this example](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/.controlplane/controlplane.yml).

Before the initial setup, add the templates for the app to the `.controlplane/controlplane.yml` file, using the `setup`
Before the initial setup, add the templates for the app to the `.controlplane/controlplane.yml` file, using the `setup_app_templates`
key, e.g.:

```yaml
my-app-staging:
<<: *common
setup:
setup_app_templates:
- gvc
- redis
- memcached
Expand Down Expand Up @@ -191,7 +191,7 @@ configure an entry for, e.g., `my-app-review`, and then create review apps start
my-app-review:
<<: *common
match_if_app_name_starts_with: true
setup:
setup_app_templates:
- gvc
- redis
- memcached
Expand Down
6 changes: 3 additions & 3 deletions lib/command/setup_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ class SetupApp < Base
DESCRIPTION = "Creates an app and all its workloads"
LONG_DESCRIPTION = <<~DESC
- Creates an app and all its workloads
- Specify the templates for the app and workloads through `setup` in the `.controlplane/controlplane.yml` file
- This should should only be used for temporary apps like review apps, never for persistent apps like production (to update workloads for those, use 'cpl apply-template' instead)
- Specify the templates for the app and workloads through `setup_app_templates` in the `.controlplane/controlplane.yml` file
- This should only be used for temporary apps like review apps, never for persistent apps like production (to update workloads for those, use 'cpl apply-template' instead)
DESC

def call
templates = config[:setup]
templates = config[:setup_app_templates]

app = cp.fetch_gvc
if app
Expand Down
1 change: 1 addition & 0 deletions lib/core/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def new_option_keys
org: :cpln_org,
location: :default_location,
prefix: :match_if_app_name_starts_with,
setup: :setup_app_templates,
old_image_retention_days: :image_retention_days
}
end
Expand Down

0 comments on commit ab7b8d3

Please sign in to comment.