lib/command/run.rb in cpl-1.1.2 vs lib/command/run.rb in cpl-1.2.0
- old
+ new
@@ -8,18 +8,18 @@
DEFAULT_ARGS = ["bash"].freeze
OPTIONS = [
app_option(required: true),
image_option,
workload_option,
+ location_option,
use_local_token_option,
terminal_size_option
].freeze
DESCRIPTION = "Runs one-off **_interactive_** replicas (analog of `heroku run`)"
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)
- 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`)
> **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`.
DESC
@@ -55,10 +55,10 @@
EX
attr_reader :location, :workload, :one_off, :container
def call # rubocop:disable Metrics/MethodLength
- @location = config[:default_location]
+ @location = config.location
@workload = config.options["workload"] || config[:one_off_workload]
@one_off = "#{workload}-run-#{rand(1000..9999)}"
step("Cloning workload '#{workload}' on app '#{config.options[:app]}' to '#{one_off}'") do
clone_workload