lib/command/run.rb in cpl-0.4.1 vs lib/command/run.rb in cpl-0.5.0
- old
+ new
@@ -9,19 +9,19 @@
OPTIONS = [
app_option(required: true),
image_option
].freeze
DESCRIPTION = "Runs one-off **_interactive_** replicas (analog of `heroku run`)"
- LONG_DESCRIPTION = <<~HEREDOC
+ LONG_DESCRIPTION = <<~DESC
- Runs one-off **_interactive_** replicas (analog of `heroku run`)
- Uses `Standard` workload type and `cpln exec` as the execution method, with CLI streaming
- May not work correctly with tasks that last over 5 minutes (there's a Control Plane scaling bug at the moment)
> **IMPORTANT:** Useful for development where it's needed for interaction, and where network connection drops and
> task crashing are tolerable. For production tasks, it's better to use `cpl run:detached`.
- HEREDOC
- EXAMPLES = <<~HEREDOC
+ DESC
+ EXAMPLES = <<~EX
```sh
# Opens shell (bash by default).
cpl run -a $APP_NAME
# Runs command, displays output, and exits shell.
@@ -33,11 +33,11 @@
# Uses a different image (which may not be promoted yet).
cpl run rails db:migrate -a $APP_NAME --image appimage:123 # Exact image name
cpl run rails db:migrate -a $APP_NAME --image latest # Latest sequential image
```
- HEREDOC
+ EX
attr_reader :location, :workload, :one_off
def call
@location = config[:default_location]
@@ -78,10 +78,10 @@
spec["defaultOptions"]["autoscaling"]["minScale"] = 1
spec["defaultOptions"]["capacityAI"] = false
# Override image if specified
image = config.options[:image]
- image = "/org/#{config[:cpln_org]}/image/#{latest_image}" if image == "latest"
+ image = "/org/#{config.org}/image/#{latest_image}" if image == "latest"
container["image"] = image if image
# Set runner
container["env"] ||= []
container["env"] << { "name" => "CONTROLPLANE_RUNNER", "value" => runner_script }