Class: Jenkins2API::Command::Build

Inherits:
ThorCommand show all
Defined in:
lib/commands/build.rb

Overview

Contains all the commands under build namespace

Instance Method Summary collapse

Instance Method Details

#slave_name(name, build_id) ⇒ Object

Displays the name of the slave where the build was executed



11
12
13
14
15
16
17
18
19
20
# File 'lib/commands/build.rb', line 11

def slave_name(name, build_id)
  slave_name = client.build.slave_name(name, build_id)
  if options[:ec2id]
    slave_name = slave_name.match(/(i-[0-9a-zA-Z]+)/)
                           .captures
                           .first
  end

  puts slave_name
end