lib/command/run_detached.rb in cpl-0.6.0 vs lib/command/run_detached.rb in cpl-0.7.0
- old
+ new
@@ -20,24 +20,27 @@
DESC
EXAMPLES = <<~EX
```sh
cpl run:detached rails db:prepare -a $APP_NAME
- # Need to quote COMMAND if setting ENV value or passing args to command to run
+ # Need to quote COMMAND if setting ENV value or passing args.
cpl run:detached 'LOG_LEVEL=warn rails db:migrate' -a $APP_NAME
+ # COMMAND may also be passed at the end (in this case, no need to quote).
+ cpl run:detached -a $APP_NAME -- rails db:migrate
+
# Uses some other image.
cpl run:detached rails db:migrate -a $APP_NAME --image /some/full/image/path
# Uses latest app image (which may not be promoted yet).
cpl run:detached rails db:migrate -a $APP_NAME --image latest
# Uses a different image (which may not be promoted yet).
cpl run:detached rails db:migrate -a $APP_NAME --image appimage:123 # Exact image name
cpl run:detached rails db:migrate -a $APP_NAME --image latest # Latest sequential image
- # Uses a different workload
+ # Uses a different workload than `one_off_workload` from `.controlplane/controlplane.yml`.
cpl run:detached rails db:migrate:status -a $APP_NAME -w other-workload
```
EX
WORKLOAD_SLEEP_CHECK = 2
@@ -77,10 +80,10 @@
# Ensure one-off workload will be running
spec["defaultOptions"]["suspend"] = false
# Ensure no scaling
spec["defaultOptions"]["autoscaling"]["minScale"] = 1
- spec["defaultOptions"]["autoscaling"]["minScale"] = 1
+ spec["defaultOptions"]["autoscaling"]["maxScale"] = 1
spec["defaultOptions"]["capacityAI"] = false
# Override image if specified
image = config.options[:image]
image = "/org/#{config.org}/image/#{latest_image}" if image == "latest"