Class: Jenkins2::CLI::WaitNodeOnline
Instance Attribute Summary
#errors, #options
Class Method Summary
collapse
Instance Method Summary
collapse
#call, class_to_command, #initialize, #parse, subcommands
Constructor Details
This class inherits a constructor from Jenkins2::CLI
Class Method Details
.description ⇒ Object
210
211
212
|
# File 'lib/jenkins2/cli/nodes.rb', line 210
def self.description
'Wait for a node to become online.'
end
|
Instance Method Details
#add_options ⇒ Object
214
215
216
217
218
219
220
221
222
223
224
|
# File 'lib/jenkins2/cli/nodes.rb', line 214
def add_options
parser.separator 'Mandatory arguments:'
parser.on '-n', '--name NAME', 'Name of the node.' do |n|
options[:name] = n
end
parser.separator 'Optional arguments:'
parser.on '-w', '--wait MINUTES', Integer, 'Maximum number of minutes to wait. Default is '\
'60.' do |w|
options[:wait] = w
end
end
|
#run ⇒ Object
226
227
228
229
230
|
# File 'lib/jenkins2/cli/nodes.rb', line 226
def run
Jenkins2::Util.wait(max_wait_minutes: options[:wait]) do
jc.computer(options[:name]).online?
end
end
|