class RoboPigeon::Dsl::Jenkins

Attributes

job[RW]

Public Class Methods

new() click to toggle source
# File lib/robopigeon/jenkins/dsl.rb, line 58
def initialize
  self.job = RoboPigeon::Jenkins::Job.new
end
run(run_now = true, &block) click to toggle source
# File lib/robopigeon/jenkins/dsl.rb, line 62
def self.run(run_now = true, &block)
  if RoboPigeon::Jenkins::Client.enabled
    instance = new
    instance.instance_eval(&block)
    instance.job.build_and_watch! if run_now
    instance.job
  else
    puts 'Jenkins is disabled, please remove `enabled false` from your global jenkins config'
  end
end

Public Instance Methods

completion_timeout(seconds) click to toggle source
# File lib/robopigeon/jenkins/dsl.rb, line 94
def completion_timeout(seconds)
  job.build_timeout = seconds
end
name(name) click to toggle source
# File lib/robopigeon/jenkins/dsl.rb, line 90
def name(name)
  job.name = name
end
param(key, value) click to toggle source
# File lib/robopigeon/jenkins/dsl.rb, line 82
def param(key, value)
  job.params[key] = value
end
start_timeout(seconds) click to toggle source
# File lib/robopigeon/jenkins/dsl.rb, line 86
def start_timeout(seconds)
  job.start_timeout = seconds
end