Move hosts/roles specification to cli args instead of ENV
This commit is contained in:
@@ -9,6 +9,9 @@ module Mrsk::Cli
|
||||
|
||||
class_option :verbose, type: :boolean, aliases: "-v", desc: "Detailed logging"
|
||||
|
||||
class_option :hosts, aliases: "-h", desc: "Run commands on these hosts instead of all (separate by comma)"
|
||||
class_option :roles, aliases: "-r", desc: "Run commands on these roles instead of all (separate by comma)"
|
||||
|
||||
class_option :config_file, aliases: "-c", default: "config/deploy.yml", desc: "Path to config file (default: config/deploy.yml)"
|
||||
class_option :destination, aliases: "-d", desc: "Specify destination to be used for config file (west -> deploy.west.yml)"
|
||||
|
||||
@@ -22,6 +25,8 @@ module Mrsk::Cli
|
||||
MRSK.tap do |commander|
|
||||
commander.config_file = Pathname.new(File.expand_path(options[:config_file]))
|
||||
commander.destination = options[:destination]
|
||||
commander.hosts = options[:hosts]&.split(",")
|
||||
commander.roles = options[:roles]&.split(",")
|
||||
commander.verbose = options[:verbose]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user