Class: JenkinsJob::FreeStyle

Inherits:
Common::Common show all
Includes:
BuildStep
Defined in:
lib/rubyjobbuilderdsl/freestyle.rb

Instance Attribute Summary collapse

Attributes inherited from Common::Common

#builder, #concurrent_, #desc_, #logrotate_, #node_, #parameters_, #postbuild_, #properties_, #quiet_period_, #scm_, #triggers_, #wrappers_

Instance Method Summary collapse

Methods inherited from Common::Common

#artifactory, #blocked_by, #concurrent, #desc, #gerrit, #git, #logrotate, #node, #parameter, #password, #password_parameter, #pollscm, #postbuild, #quiet_period, #scms, #timed, #timeout, #timestamps

Constructor Details

#initialize(name, builder) ⇒ FreeStyle

Returns a new instance of FreeStyle.



14
15
16
17
18
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 14

def initialize(name, builder)
  super(builder)
  @name = name
  @builders_ = []
end

Instance Attribute Details

#builders_Object (readonly)

Returns the value of attribute builders_.



12
13
14
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 12

def builders_
  @builders_
end

#nameObject (readonly)

Returns the value of attribute name.



12
13
14
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 12

def name
  @name
end

#workspace_Object (readonly)

Returns the value of attribute workspace_.



12
13
14
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 12

def workspace_
  @workspace_
end

Instance Method Details

#ant(&block) ⇒ Object



50
51
52
53
54
55
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 50

def ant(&block)
  ant = Ant.new
  ant.instance_eval(&block) if block_given?

  @builders_ << ant
end

#batch(cmd) ⇒ Object



28
29
30
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 28

def batch(cmd)
  @builders_ << Batch.new(cmd)
end

#copyartifact(artifact_job, &block) ⇒ Object



57
58
59
60
61
62
63
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 57

def copyartifact(artifact_job, &block)
  # sandbox for copy artifacts dsl
  copyartifact = CopyArtifact.new(artifact_job)
  copyartifact.instance_eval(&block)

  @builders_ << copyartifact
end

#inject_env(&block) ⇒ Object



36
37
38
39
40
41
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 36

def inject_env(&block)
  inject = InjectEnv.new
  inject.instance_eval(&block) if block_given?

  @builders_ << inject
end

#powershell(cmd) ⇒ Object



32
33
34
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 32

def powershell(cmd)
  @builders_ << Powershell.new(cmd)
end

#shell(cmd) ⇒ Object



24
25
26
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 24

def shell(cmd)
  @builders_ << Shell.new(cmd)
end

#workspace(value) ⇒ Object



20
21
22
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 20

def workspace(value)
  @workspace_ = value
end

#xvfb(&block) ⇒ Object



43
44
45
46
47
48
# File 'lib/rubyjobbuilderdsl/freestyle.rb', line 43

def xvfb(&block)
  xvfb = Xvfb.new
  xvfb.instance_eval(&block) if block_given?

  @wrappers_['xvfb'] = xvfb
end