rubyjobbuilderdsl 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +13 -5
- data/Gemfile +6 -6
- data/Gemfile.lock +41 -41
- data/LICENSE +18 -18
- data/Rakefile +12 -12
- data/docs/common.md +313 -313
- data/docs/flow.md +17 -17
- data/docs/freestyle.md +100 -100
- data/docs/gerrit.md +70 -70
- data/docs/git.md +88 -88
- data/docs/multi.md +26 -26
- data/docs/overview.md +74 -74
- data/docs/postbuild.md +266 -266
- data/docs/view.md +13 -13
- data/lib/rubyjobbuilderdsl.rb +2 -2
- data/lib/rubyjobbuilderdsl/buildstep/ant.rb +29 -29
- data/lib/rubyjobbuilderdsl/buildstep/copyartifact.rb +23 -23
- data/lib/rubyjobbuilderdsl/buildstep/inject_env.rb +18 -18
- data/lib/rubyjobbuilderdsl/buildstep/phase.rb +19 -19
- data/lib/rubyjobbuilderdsl/buildstep/phase_job.rb +26 -26
- data/lib/rubyjobbuilderdsl/buildstep/shell.rb +24 -24
- data/lib/rubyjobbuilderdsl/buildstep/xvfb.rb +46 -46
- data/lib/rubyjobbuilderdsl/common.rb +140 -140
- data/lib/rubyjobbuilderdsl/common/artifactory.rb +33 -33
- data/lib/rubyjobbuilderdsl/common/blocking_job.rb +11 -11
- data/lib/rubyjobbuilderdsl/common/build_timeout.rb +23 -23
- data/lib/rubyjobbuilderdsl/common/gerrit.rb +53 -53
- data/lib/rubyjobbuilderdsl/common/git.rb +76 -76
- data/lib/rubyjobbuilderdsl/common/logrotate.rb +24 -24
- data/lib/rubyjobbuilderdsl/common/parameter.rb +22 -22
- data/lib/rubyjobbuilderdsl/common/password.rb +12 -12
- data/lib/rubyjobbuilderdsl/common/pollscm.rb +10 -10
- data/lib/rubyjobbuilderdsl/common/scms.rb +18 -18
- data/lib/rubyjobbuilderdsl/common/throttle.rb +24 -24
- data/lib/rubyjobbuilderdsl/common/timed.rb +10 -10
- data/lib/rubyjobbuilderdsl/common/timestamps.rb +6 -6
- data/lib/rubyjobbuilderdsl/deployer.rb +95 -95
- data/lib/rubyjobbuilderdsl/flow.rb +14 -14
- data/lib/rubyjobbuilderdsl/freestyle.rb +65 -65
- data/lib/rubyjobbuilderdsl/jenkins_client.rb +203 -203
- data/lib/rubyjobbuilderdsl/multijob.rb +24 -24
- data/lib/rubyjobbuilderdsl/postbuild.rb +160 -160
- data/lib/rubyjobbuilderdsl/postbuild/archive.rb +23 -23
- data/lib/rubyjobbuilderdsl/postbuild/chucknorris_publisher.rb +6 -6
- data/lib/rubyjobbuilderdsl/postbuild/claim_publisher.rb +6 -6
- data/lib/rubyjobbuilderdsl/postbuild/cloverphp_publisher.rb +36 -36
- data/lib/rubyjobbuilderdsl/postbuild/cucumber_json_publisher.rb +20 -20
- data/lib/rubyjobbuilderdsl/postbuild/email_publisher.rb +23 -23
- data/lib/rubyjobbuilderdsl/postbuild/game_publisher.rb +6 -6
- data/lib/rubyjobbuilderdsl/postbuild/groovy.rb +10 -10
- data/lib/rubyjobbuilderdsl/postbuild/html_publisher.rb +27 -27
- data/lib/rubyjobbuilderdsl/postbuild/javadoc_publisher.rb +19 -19
- data/lib/rubyjobbuilderdsl/postbuild/logparser.rb +21 -21
- data/lib/rubyjobbuilderdsl/postbuild/nunit_publisher.rb +21 -21
- data/lib/rubyjobbuilderdsl/postbuild/pmd_publisher.rb +19 -19
- data/lib/rubyjobbuilderdsl/postbuild/script.rb +14 -14
- data/lib/rubyjobbuilderdsl/postbuild/tap_publisher.rb +44 -44
- data/lib/rubyjobbuilderdsl/postbuild/trigger.rb +38 -38
- data/lib/rubyjobbuilderdsl/postbuild/xunit_publisher.rb +35 -35
- data/lib/rubyjobbuilderdsl/view.rb +14 -14
- data/lib/rubyjobbuilderdsl/xml_generator.rb +1 -1
- data/rubyjobbuilderdsl.gemspec +2 -2
- data/rubyjobbuilderdsl.sublime-project +14 -14
- data/run_tests.sh +7 -7
- data/sample/hello_mars.rb +27 -27
- data/sample/hello_mars.xml +18 -0
- data/sample/hello_world-post.xml +40 -0
- data/sample/local.ini +4 -4
- data/sample/test.xml +21 -0
- data/test/test_ant.rb +38 -38
- data/test/test_archive.rb +24 -24
- data/test/test_artifactory.rb +26 -26
- data/test/test_blocking_job.rb +18 -18
- data/test/test_chucknorris_publisher.rb +17 -17
- data/test/test_claim_publisher.rb +17 -17
- data/test/test_cloverphp.rb +33 -33
- data/test/test_concurrent.rb +44 -44
- data/test/test_copyartifact.rb +45 -45
- data/test/test_cucumber_json_publisher.rb +30 -30
- data/test/test_default_setting.rb +29 -29
- data/test/test_email_publisher.rb +44 -44
- data/test/test_flow.rb +19 -19
- data/test/test_freestyle.rb +52 -52
- data/test/test_game_publisher.rb +17 -17
- data/test/test_gerrit.rb +117 -117
- data/test/test_git.rb +80 -80
- data/test/test_html_publisher.rb +57 -57
- data/test/test_inject.rb +23 -23
- data/test/test_javadoc.rb +22 -22
- data/test/test_logparser.rb +24 -24
- data/test/test_logrotate.rb +22 -22
- data/test/test_multijob.rb +50 -50
- data/test/test_nunit_publisher.rb +20 -20
- data/test/test_parameter.rb +44 -44
- data/test/test_password.rb +17 -17
- data/test/test_pmd.rb +22 -22
- data/test/test_pollscm.rb +15 -15
- data/test/test_postbuild_groovy.rb +21 -21
- data/test/test_postbuild_script.rb +24 -24
- data/test/test_postbuild_trigger.rb +170 -170
- data/test/test_scms.rb +31 -31
- data/test/test_tap_publisher.rb +25 -25
- data/test/test_timed.rb +15 -15
- data/test/test_timeout.rb +20 -20
- data/test/test_timestamps.rb +14 -14
- data/test/test_xml_generator.rb +28 -28
- data/test/test_xunit_publisher.rb +22 -22
- data/test/test_xvfb.rb +35 -35
- metadata +11 -10
- data/rubyjobbuilderdsl-0.0.3.gem +0 -0
- data/sample/Schedule-sample-pipeline.xml +0 -32
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
module JenkinsJob
|
|
2
|
-
module Common
|
|
3
|
-
class Parameter < BasicObject
|
|
4
|
-
attr_reader :name, :default_, :description_
|
|
5
|
-
|
|
6
|
-
def initialize(name)
|
|
7
|
-
@name = name
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def default(value)
|
|
11
|
-
@default_ = value
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def description(value)
|
|
15
|
-
@description_ = value
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
class PasswordParameter < Parameter
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
1
|
+
module JenkinsJob
|
|
2
|
+
module Common
|
|
3
|
+
class Parameter < BasicObject
|
|
4
|
+
attr_reader :name, :default_, :description_
|
|
5
|
+
|
|
6
|
+
def initialize(name)
|
|
7
|
+
@name = name
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def default(value)
|
|
11
|
+
@default_ = value
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def description(value)
|
|
15
|
+
@description_ = value
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class PasswordParameter < Parameter
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
module JenkinsJob
|
|
2
|
-
module Common
|
|
3
|
-
class Password < BasicObject
|
|
4
|
-
attr_reader :name_, :password_
|
|
5
|
-
|
|
6
|
-
def initialize(name, password)
|
|
7
|
-
@name_ = name
|
|
8
|
-
@password_ = password
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
1
|
+
module JenkinsJob
|
|
2
|
+
module Common
|
|
3
|
+
class Password < BasicObject
|
|
4
|
+
attr_reader :name_, :password_
|
|
5
|
+
|
|
6
|
+
def initialize(name, password)
|
|
7
|
+
@name_ = name
|
|
8
|
+
@password_ = password
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
module JenkinsJob
|
|
2
|
-
module Common
|
|
3
|
-
class PollSCM < BasicObject
|
|
4
|
-
attr_reader :value_
|
|
5
|
-
def initialize(value)
|
|
6
|
-
@value_ = value
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
end
|
|
1
|
+
module JenkinsJob
|
|
2
|
+
module Common
|
|
3
|
+
class PollSCM < BasicObject
|
|
4
|
+
attr_reader :value_
|
|
5
|
+
def initialize(value)
|
|
6
|
+
@value_ = value
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
module JenkinsJob
|
|
2
|
-
module Common
|
|
3
|
-
class Scms < BasicObject
|
|
4
|
-
attr_reader :scms_
|
|
5
|
-
|
|
6
|
-
def initialize
|
|
7
|
-
@scms_ = []
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def git(&block)
|
|
11
|
-
git = Git.new
|
|
12
|
-
git.instance_eval(&block)
|
|
13
|
-
|
|
14
|
-
@scms_ << git
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
1
|
+
module JenkinsJob
|
|
2
|
+
module Common
|
|
3
|
+
class Scms < BasicObject
|
|
4
|
+
attr_reader :scms_
|
|
5
|
+
|
|
6
|
+
def initialize
|
|
7
|
+
@scms_ = []
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def git(&block)
|
|
11
|
+
git = Git.new
|
|
12
|
+
git.instance_eval(&block)
|
|
13
|
+
|
|
14
|
+
@scms_ << git
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
module JenkinsJob
|
|
2
|
-
module Common
|
|
3
|
-
class Throttle < BasicObject
|
|
4
|
-
attr_reader :categories_, :max_per_node_, :max_total_
|
|
5
|
-
|
|
6
|
-
def initialize
|
|
7
|
-
@max_per_node_ = 1
|
|
8
|
-
@max_total_ = 0
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def max_per_node(value)
|
|
12
|
-
@max_per_node_ = value
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def max_total(value)
|
|
16
|
-
@max_total_ = value
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def category(*value)
|
|
20
|
-
@categories_ = value
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
1
|
+
module JenkinsJob
|
|
2
|
+
module Common
|
|
3
|
+
class Throttle < BasicObject
|
|
4
|
+
attr_reader :categories_, :max_per_node_, :max_total_
|
|
5
|
+
|
|
6
|
+
def initialize
|
|
7
|
+
@max_per_node_ = 1
|
|
8
|
+
@max_total_ = 0
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def max_per_node(value)
|
|
12
|
+
@max_per_node_ = value
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def max_total(value)
|
|
16
|
+
@max_total_ = value
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def category(*value)
|
|
20
|
+
@categories_ = value
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
module JenkinsJob
|
|
2
|
-
module Common
|
|
3
|
-
class Timed < BasicObject
|
|
4
|
-
attr_reader :value_
|
|
5
|
-
def initialize(value)
|
|
6
|
-
@value_ = value
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
end
|
|
1
|
+
module JenkinsJob
|
|
2
|
+
module Common
|
|
3
|
+
class Timed < BasicObject
|
|
4
|
+
attr_reader :value_
|
|
5
|
+
def initialize(value)
|
|
6
|
+
@value_ = value
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
module JenkinsJob
|
|
2
|
-
module Common
|
|
3
|
-
class Timestamps < BasicObject
|
|
4
|
-
end
|
|
5
|
-
end
|
|
6
|
-
end
|
|
1
|
+
module JenkinsJob
|
|
2
|
+
module Common
|
|
3
|
+
class Timestamps < BasicObject
|
|
4
|
+
end
|
|
5
|
+
end
|
|
6
|
+
end
|
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
require_relative './jenkins_client'
|
|
2
|
-
|
|
3
|
-
module JenkinsJob
|
|
4
|
-
class Deployer
|
|
5
|
-
def initialize(*builder)
|
|
6
|
-
@builders = builder
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def each(&block)
|
|
10
|
-
@builders.each do |b|
|
|
11
|
-
b.generate_xml do |name, xml, type|
|
|
12
|
-
yield name, xml, type if block
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def generate_xml
|
|
18
|
-
outputdir = ARGV.find { |z| z =~ /--output-dir=/ }.to_s.split('=')[1]
|
|
19
|
-
usage unless outputdir
|
|
20
|
-
|
|
21
|
-
each do |name, xml, type|
|
|
22
|
-
path = "#{outputdir}/#{name}.xml"
|
|
23
|
-
$stdout.puts "creating #{type} #{path}"
|
|
24
|
-
File.open(path, 'w+') do |f|
|
|
25
|
-
f.write(xml)
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def deploy(&block)
|
|
31
|
-
config_file = ARGV.find { |z| z =~ /--config-file=/ }.to_s.split('=')[1]
|
|
32
|
-
usage unless config_file
|
|
33
|
-
|
|
34
|
-
config = {}
|
|
35
|
-
File.read(config_file).each_line do |line|
|
|
36
|
-
if line =~ /\S+\=\S+/
|
|
37
|
-
key, val = line.split('=')
|
|
38
|
-
config[key] = val.chomp
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
client = JenkinsClient.new(config['url'], config['user'], config['password'])
|
|
43
|
-
deployer = self
|
|
44
|
-
client.instance_eval do
|
|
45
|
-
@deployer = deployer
|
|
46
|
-
def each(&block)
|
|
47
|
-
@deployer.each(&block)
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
unless block
|
|
52
|
-
block = proc do
|
|
53
|
-
each do |name, xml, type|
|
|
54
|
-
upload_job(name, xml) if type == :job
|
|
55
|
-
upload_view(name, xml) if type == :view
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
client.instance_eval(&block)
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def usage
|
|
64
|
-
$stderr.puts(<<-EOS
|
|
65
|
-
Usage:
|
|
66
|
-
|
|
67
|
-
ruby #{File.basename($PROGRAM_NAME)} --xml --output-dir=.|--deploy --config-file=config/localhost.ini]
|
|
68
|
-
|
|
69
|
-
Example:
|
|
70
|
-
|
|
71
|
-
ruby #{File.basename($PROGRAM_NAME)} --xml --output-dir=.
|
|
72
|
-
ruby #{File.basename($PROGRAM_NAME)} --deploy --config-file=config/localhost.ini
|
|
73
|
-
EOS
|
|
74
|
-
)
|
|
75
|
-
exit 1
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def run(&block)
|
|
79
|
-
xml = ARGV.find { |a| a == '--xml' }
|
|
80
|
-
deploy = ARGV.find { |a| a == '--deploy' }
|
|
81
|
-
|
|
82
|
-
if xml
|
|
83
|
-
generate_xml
|
|
84
|
-
exit 0
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
if deploy
|
|
88
|
-
deploy(&block)
|
|
89
|
-
exit 0
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
usage
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
1
|
+
require_relative './jenkins_client'
|
|
2
|
+
|
|
3
|
+
module JenkinsJob
|
|
4
|
+
class Deployer
|
|
5
|
+
def initialize(*builder)
|
|
6
|
+
@builders = builder
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def each(&block)
|
|
10
|
+
@builders.each do |b|
|
|
11
|
+
b.generate_xml do |name, xml, type|
|
|
12
|
+
yield name, xml, type if block
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def generate_xml
|
|
18
|
+
outputdir = ARGV.find { |z| z =~ /--output-dir=/ }.to_s.split('=')[1]
|
|
19
|
+
usage unless outputdir
|
|
20
|
+
|
|
21
|
+
each do |name, xml, type|
|
|
22
|
+
path = "#{outputdir}/#{name}.xml"
|
|
23
|
+
$stdout.puts "creating #{type} #{path}"
|
|
24
|
+
File.open(path, 'w+') do |f|
|
|
25
|
+
f.write(xml)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def deploy(&block)
|
|
31
|
+
config_file = ARGV.find { |z| z =~ /--config-file=/ }.to_s.split('=')[1]
|
|
32
|
+
usage unless config_file
|
|
33
|
+
|
|
34
|
+
config = {}
|
|
35
|
+
File.read(config_file).each_line do |line|
|
|
36
|
+
if line =~ /\S+\=\S+/
|
|
37
|
+
key, val = line.split('=')
|
|
38
|
+
config[key] = val.chomp
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
client = JenkinsClient.new(config['url'], config['user'], config['password'])
|
|
43
|
+
deployer = self
|
|
44
|
+
client.instance_eval do
|
|
45
|
+
@deployer = deployer
|
|
46
|
+
def each(&block)
|
|
47
|
+
@deployer.each(&block)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
unless block
|
|
52
|
+
block = proc do
|
|
53
|
+
each do |name, xml, type|
|
|
54
|
+
upload_job(name, xml) if type == :job
|
|
55
|
+
upload_view(name, xml) if type == :view
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
client.instance_eval(&block)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def usage
|
|
64
|
+
$stderr.puts(<<-EOS
|
|
65
|
+
Usage:
|
|
66
|
+
|
|
67
|
+
ruby #{File.basename($PROGRAM_NAME)} --xml --output-dir=.|--deploy --config-file=config/localhost.ini]
|
|
68
|
+
|
|
69
|
+
Example:
|
|
70
|
+
|
|
71
|
+
ruby #{File.basename($PROGRAM_NAME)} --xml --output-dir=.
|
|
72
|
+
ruby #{File.basename($PROGRAM_NAME)} --deploy --config-file=config/localhost.ini
|
|
73
|
+
EOS
|
|
74
|
+
)
|
|
75
|
+
exit 1
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def run(&block)
|
|
79
|
+
xml = ARGV.find { |a| a == '--xml' }
|
|
80
|
+
deploy = ARGV.find { |a| a == '--deploy' }
|
|
81
|
+
|
|
82
|
+
if xml
|
|
83
|
+
generate_xml
|
|
84
|
+
exit 0
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if deploy
|
|
88
|
+
deploy(&block)
|
|
89
|
+
exit 0
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
usage
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
module JenkinsJob
|
|
2
|
-
class Flow < Common::Common
|
|
3
|
-
attr_reader :name, :dsl_
|
|
4
|
-
|
|
5
|
-
def initialize(name, builder)
|
|
6
|
-
super(builder)
|
|
7
|
-
@name = name
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def dsl(value)
|
|
11
|
-
@dsl_ = value
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
1
|
+
module JenkinsJob
|
|
2
|
+
class Flow < Common::Common
|
|
3
|
+
attr_reader :name, :dsl_
|
|
4
|
+
|
|
5
|
+
def initialize(name, builder)
|
|
6
|
+
super(builder)
|
|
7
|
+
@name = name
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def dsl(value)
|
|
11
|
+
@dsl_ = value
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
require_relative './common'
|
|
2
|
-
require_relative './buildstep/shell'
|
|
3
|
-
require_relative './buildstep/copyartifact'
|
|
4
|
-
require_relative './buildstep/inject_env'
|
|
5
|
-
require_relative './buildstep/ant'
|
|
6
|
-
require_relative './buildstep/xvfb'
|
|
7
|
-
|
|
8
|
-
module JenkinsJob
|
|
9
|
-
class FreeStyle < Common::Common
|
|
10
|
-
include BuildStep
|
|
11
|
-
|
|
12
|
-
attr_reader :name, :workspace_, :builders_
|
|
13
|
-
|
|
14
|
-
def initialize(name, builder)
|
|
15
|
-
super(builder)
|
|
16
|
-
@name = name
|
|
17
|
-
@builders_ = []
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def workspace(value)
|
|
21
|
-
@workspace_ = value
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def shell(cmd)
|
|
25
|
-
@builders_ << Shell.new(cmd)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def batch(cmd)
|
|
29
|
-
@builders_ << Batch.new(cmd)
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def powershell(cmd)
|
|
33
|
-
@builders_ << Powershell.new(cmd)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def inject_env(&block)
|
|
37
|
-
inject = InjectEnv.new
|
|
38
|
-
inject.instance_eval(&block) if block_given?
|
|
39
|
-
|
|
40
|
-
@builders_ << inject
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def xvfb(&block)
|
|
44
|
-
xvfb = Xvfb.new
|
|
45
|
-
xvfb.instance_eval(&block) if block_given?
|
|
46
|
-
|
|
47
|
-
@wrappers_['xvfb'] = xvfb
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def ant(&block)
|
|
51
|
-
ant = Ant.new
|
|
52
|
-
ant.instance_eval(&block) if block_given?
|
|
53
|
-
|
|
54
|
-
@builders_ << ant
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def copyartifact(artifact_job, &block)
|
|
58
|
-
# sandbox for copy artifacts dsl
|
|
59
|
-
copyartifact = CopyArtifact.new(artifact_job)
|
|
60
|
-
copyartifact.instance_eval(&block)
|
|
61
|
-
|
|
62
|
-
@builders_ << copyartifact
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
1
|
+
require_relative './common'
|
|
2
|
+
require_relative './buildstep/shell'
|
|
3
|
+
require_relative './buildstep/copyartifact'
|
|
4
|
+
require_relative './buildstep/inject_env'
|
|
5
|
+
require_relative './buildstep/ant'
|
|
6
|
+
require_relative './buildstep/xvfb'
|
|
7
|
+
|
|
8
|
+
module JenkinsJob
|
|
9
|
+
class FreeStyle < Common::Common
|
|
10
|
+
include BuildStep
|
|
11
|
+
|
|
12
|
+
attr_reader :name, :workspace_, :builders_
|
|
13
|
+
|
|
14
|
+
def initialize(name, builder)
|
|
15
|
+
super(builder)
|
|
16
|
+
@name = name
|
|
17
|
+
@builders_ = []
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def workspace(value)
|
|
21
|
+
@workspace_ = value
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def shell(cmd)
|
|
25
|
+
@builders_ << Shell.new(cmd)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def batch(cmd)
|
|
29
|
+
@builders_ << Batch.new(cmd)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def powershell(cmd)
|
|
33
|
+
@builders_ << Powershell.new(cmd)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def inject_env(&block)
|
|
37
|
+
inject = InjectEnv.new
|
|
38
|
+
inject.instance_eval(&block) if block_given?
|
|
39
|
+
|
|
40
|
+
@builders_ << inject
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def xvfb(&block)
|
|
44
|
+
xvfb = Xvfb.new
|
|
45
|
+
xvfb.instance_eval(&block) if block_given?
|
|
46
|
+
|
|
47
|
+
@wrappers_['xvfb'] = xvfb
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def ant(&block)
|
|
51
|
+
ant = Ant.new
|
|
52
|
+
ant.instance_eval(&block) if block_given?
|
|
53
|
+
|
|
54
|
+
@builders_ << ant
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def copyartifact(artifact_job, &block)
|
|
58
|
+
# sandbox for copy artifacts dsl
|
|
59
|
+
copyartifact = CopyArtifact.new(artifact_job)
|
|
60
|
+
copyartifact.instance_eval(&block)
|
|
61
|
+
|
|
62
|
+
@builders_ << copyartifact
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|