rubyjobbuilderdsl 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +13 -5
  2. data/Gemfile +6 -6
  3. data/Gemfile.lock +41 -41
  4. data/LICENSE +18 -18
  5. data/Rakefile +12 -12
  6. data/docs/common.md +313 -313
  7. data/docs/flow.md +17 -17
  8. data/docs/freestyle.md +100 -100
  9. data/docs/gerrit.md +70 -70
  10. data/docs/git.md +88 -88
  11. data/docs/multi.md +26 -26
  12. data/docs/overview.md +74 -74
  13. data/docs/postbuild.md +266 -266
  14. data/docs/view.md +13 -13
  15. data/lib/rubyjobbuilderdsl/buildstep/ant.rb +29 -29
  16. data/lib/rubyjobbuilderdsl/buildstep/copyartifact.rb +23 -23
  17. data/lib/rubyjobbuilderdsl/buildstep/inject_env.rb +18 -18
  18. data/lib/rubyjobbuilderdsl/buildstep/phase.rb +19 -19
  19. data/lib/rubyjobbuilderdsl/buildstep/phase_job.rb +26 -26
  20. data/lib/rubyjobbuilderdsl/buildstep/shell.rb +24 -24
  21. data/lib/rubyjobbuilderdsl/buildstep/xvfb.rb +46 -46
  22. data/lib/rubyjobbuilderdsl/common/artifactory.rb +33 -33
  23. data/lib/rubyjobbuilderdsl/common/blocking_job.rb +11 -11
  24. data/lib/rubyjobbuilderdsl/common/build_timeout.rb +23 -23
  25. data/lib/rubyjobbuilderdsl/common/gerrit.rb +53 -53
  26. data/lib/rubyjobbuilderdsl/common/git.rb +76 -76
  27. data/lib/rubyjobbuilderdsl/common/logrotate.rb +24 -24
  28. data/lib/rubyjobbuilderdsl/common/parameter.rb +22 -22
  29. data/lib/rubyjobbuilderdsl/common/password.rb +12 -12
  30. data/lib/rubyjobbuilderdsl/common/pollscm.rb +10 -10
  31. data/lib/rubyjobbuilderdsl/common/scms.rb +18 -18
  32. data/lib/rubyjobbuilderdsl/common/throttle.rb +24 -24
  33. data/lib/rubyjobbuilderdsl/common/timed.rb +10 -10
  34. data/lib/rubyjobbuilderdsl/common/timestamps.rb +6 -6
  35. data/lib/rubyjobbuilderdsl/common.rb +140 -140
  36. data/lib/rubyjobbuilderdsl/deployer.rb +95 -95
  37. data/lib/rubyjobbuilderdsl/flow.rb +14 -14
  38. data/lib/rubyjobbuilderdsl/freestyle.rb +65 -65
  39. data/lib/rubyjobbuilderdsl/jenkins_client.rb +203 -203
  40. data/lib/rubyjobbuilderdsl/multijob.rb +24 -24
  41. data/lib/rubyjobbuilderdsl/postbuild/archive.rb +23 -23
  42. data/lib/rubyjobbuilderdsl/postbuild/chucknorris_publisher.rb +6 -6
  43. data/lib/rubyjobbuilderdsl/postbuild/claim_publisher.rb +6 -6
  44. data/lib/rubyjobbuilderdsl/postbuild/cloverphp_publisher.rb +36 -36
  45. data/lib/rubyjobbuilderdsl/postbuild/cucumber_json_publisher.rb +20 -20
  46. data/lib/rubyjobbuilderdsl/postbuild/email_publisher.rb +23 -23
  47. data/lib/rubyjobbuilderdsl/postbuild/game_publisher.rb +6 -6
  48. data/lib/rubyjobbuilderdsl/postbuild/groovy.rb +10 -10
  49. data/lib/rubyjobbuilderdsl/postbuild/html_publisher.rb +27 -27
  50. data/lib/rubyjobbuilderdsl/postbuild/javadoc_publisher.rb +19 -19
  51. data/lib/rubyjobbuilderdsl/postbuild/logparser.rb +21 -21
  52. data/lib/rubyjobbuilderdsl/postbuild/nunit_publisher.rb +21 -21
  53. data/lib/rubyjobbuilderdsl/postbuild/pmd_publisher.rb +19 -19
  54. data/lib/rubyjobbuilderdsl/postbuild/script.rb +14 -14
  55. data/lib/rubyjobbuilderdsl/postbuild/slack.rb +77 -0
  56. data/lib/rubyjobbuilderdsl/postbuild/tap_publisher.rb +44 -44
  57. data/lib/rubyjobbuilderdsl/postbuild/trigger.rb +38 -38
  58. data/lib/rubyjobbuilderdsl/postbuild/xunit_publisher.rb +35 -35
  59. data/lib/rubyjobbuilderdsl/postbuild.rb +160 -153
  60. data/lib/rubyjobbuilderdsl/view.rb +14 -14
  61. data/lib/rubyjobbuilderdsl/xml_generator.rb +34 -1
  62. data/lib/rubyjobbuilderdsl.rb +2 -2
  63. data/rubyjobbuilderdsl.gemspec +13 -13
  64. data/rubyjobbuilderdsl.sublime-project +14 -14
  65. data/run_tests.sh +7 -7
  66. data/sample/hello_mars.rb +27 -27
  67. data/sample/hello_mars.xml +18 -0
  68. data/sample/hello_world-post.xml +40 -0
  69. data/sample/local.ini +4 -4
  70. data/sample/sample_flow.rb +15 -0
  71. data/sample/sample_slack_postbuild.rb +23 -0
  72. data/sample/test.xml +21 -0
  73. data/test/test_ant.rb +38 -38
  74. data/test/test_archive.rb +24 -24
  75. data/test/test_artifactory.rb +26 -26
  76. data/test/test_blocking_job.rb +18 -18
  77. data/test/test_chucknorris_publisher.rb +17 -17
  78. data/test/test_claim_publisher.rb +17 -17
  79. data/test/test_cloverphp.rb +33 -33
  80. data/test/test_concurrent.rb +44 -44
  81. data/test/test_copyartifact.rb +45 -45
  82. data/test/test_cucumber_json_publisher.rb +30 -30
  83. data/test/test_default_setting.rb +29 -29
  84. data/test/test_email_publisher.rb +44 -44
  85. data/test/test_flow.rb +19 -19
  86. data/test/test_freestyle.rb +52 -52
  87. data/test/test_game_publisher.rb +17 -17
  88. data/test/test_gerrit.rb +117 -117
  89. data/test/test_git.rb +80 -80
  90. data/test/test_html_publisher.rb +57 -57
  91. data/test/test_inject.rb +23 -23
  92. data/test/test_javadoc.rb +22 -22
  93. data/test/test_logparser.rb +24 -24
  94. data/test/test_logrotate.rb +22 -22
  95. data/test/test_multijob.rb +50 -50
  96. data/test/test_nunit_publisher.rb +20 -20
  97. data/test/test_parameter.rb +44 -44
  98. data/test/test_password.rb +17 -17
  99. data/test/test_pmd.rb +22 -22
  100. data/test/test_pollscm.rb +15 -15
  101. data/test/test_postbuild_groovy.rb +21 -21
  102. data/test/test_postbuild_script.rb +24 -24
  103. data/test/test_postbuild_trigger.rb +170 -170
  104. data/test/test_scms.rb +31 -31
  105. data/test/test_tap_publisher.rb +25 -25
  106. data/test/test_timed.rb +15 -15
  107. data/test/test_timeout.rb +20 -20
  108. data/test/test_timestamps.rb +14 -14
  109. data/test/test_xml_generator.rb +28 -28
  110. data/test/test_xunit_publisher.rb +22 -22
  111. data/test/test_xvfb.rb +35 -35
  112. metadata +15 -10
  113. data/sample/Schedule-sample-pipeline.xml +0 -28
data/docs/view.md CHANGED
@@ -1,13 +1,13 @@
1
- ## Create view
2
-
3
- **view**
4
-
5
- Description: create a list view
6
-
7
- Multiple: Add
8
-
9
- Example
10
-
11
- builder.view 'test' do
12
- job 'test-.*'
13
- end
1
+ ## Create view
2
+
3
+ **view**
4
+
5
+ Description: create a list view
6
+
7
+ Multiple: Add
8
+
9
+ Example
10
+
11
+ builder.view 'test' do
12
+ job 'test-.*'
13
+ end
@@ -1,29 +1,29 @@
1
- module JenkinsJob
2
- module BuildStep
3
- class Ant < BasicObject
4
- attr_reader :targets_, :buildfile_, :properties_, :java_opts_
5
-
6
- def initialize
7
- @targets_ = []
8
- @properties_ = {}
9
- @java_opts_ = []
10
- end
11
-
12
- def target(*value)
13
- @targets_ = value
14
- end
15
-
16
- def buildfile(value)
17
- @buildfile_ = value
18
- end
19
-
20
- def property(value)
21
- @properties_ = value
22
- end
23
-
24
- def java_opts(*value)
25
- @java_opts_ = value
26
- end
27
- end
28
- end
29
- end
1
+ module JenkinsJob
2
+ module BuildStep
3
+ class Ant < BasicObject
4
+ attr_reader :targets_, :buildfile_, :properties_, :java_opts_
5
+
6
+ def initialize
7
+ @targets_ = []
8
+ @properties_ = {}
9
+ @java_opts_ = []
10
+ end
11
+
12
+ def target(*value)
13
+ @targets_ = value
14
+ end
15
+
16
+ def buildfile(value)
17
+ @buildfile_ = value
18
+ end
19
+
20
+ def property(value)
21
+ @properties_ = value
22
+ end
23
+
24
+ def java_opts(*value)
25
+ @java_opts_ = value
26
+ end
27
+ end
28
+ end
29
+ end
@@ -1,23 +1,23 @@
1
- module JenkinsJob
2
- module BuildStep
3
- class CopyArtifact < BasicObject
4
- attr_reader :project_, :filter_, :target_, :build_number_
5
-
6
- def initialize(artifact_job)
7
- @project_ = artifact_job
8
- end
9
-
10
- def file(*files)
11
- @filter_ = files.join(',')
12
- end
13
-
14
- def to(dir)
15
- @target_ = dir
16
- end
17
-
18
- def build_number(value = nil)
19
- @build_number_ = value
20
- end
21
- end
22
- end
23
- end
1
+ module JenkinsJob
2
+ module BuildStep
3
+ class CopyArtifact < BasicObject
4
+ attr_reader :project_, :filter_, :target_, :build_number_
5
+
6
+ def initialize(artifact_job)
7
+ @project_ = artifact_job
8
+ end
9
+
10
+ def file(*files)
11
+ @filter_ = files.join(',')
12
+ end
13
+
14
+ def to(dir)
15
+ @target_ = dir
16
+ end
17
+
18
+ def build_number(value = nil)
19
+ @build_number_ = value
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,18 +1,18 @@
1
- module JenkinsJob
2
- module BuildStep
3
- class InjectEnv < BasicObject
4
- attr_reader :properties_content_, :properties_file_
5
-
6
- def initialize
7
- end
8
-
9
- def properties_content(value)
10
- @properties_content_ = value
11
- end
12
-
13
- def properties_file(value)
14
- @properties_file_ = value
15
- end
16
- end
17
- end
18
- end
1
+ module JenkinsJob
2
+ module BuildStep
3
+ class InjectEnv < BasicObject
4
+ attr_reader :properties_content_, :properties_file_
5
+
6
+ def initialize
7
+ end
8
+
9
+ def properties_content(value)
10
+ @properties_content_ = value
11
+ end
12
+
13
+ def properties_file(value)
14
+ @properties_file_ = value
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,19 +1,19 @@
1
- module JenkinsJob
2
- module BuildStep
3
- class Phase < BasicObject
4
- attr_reader :name, :jobs_
5
-
6
- def initialize(name)
7
- @name = name
8
- @jobs_ = []
9
- end
10
-
11
- def job(name, &block)
12
- job = PhaseJob.new(name)
13
- job.instance_eval(&block) if block
14
-
15
- @jobs_ << job
16
- end
17
- end
18
- end
19
- end
1
+ module JenkinsJob
2
+ module BuildStep
3
+ class Phase < BasicObject
4
+ attr_reader :name, :jobs_
5
+
6
+ def initialize(name)
7
+ @name = name
8
+ @jobs_ = []
9
+ end
10
+
11
+ def job(name, &block)
12
+ job = PhaseJob.new(name)
13
+ job.instance_eval(&block) if block
14
+
15
+ @jobs_ << job
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,26 +1,26 @@
1
- module JenkinsJob
2
- module BuildStep
3
- class PhaseJob < BasicObject
4
- attr_reader :name, :ignore_result_, :retries_, :abort_others_
5
-
6
- def initialize(name)
7
- @name = name
8
- @ignore_result_ = false
9
- @retries_ = 0
10
- @abort_others_ = false
11
- end
12
-
13
- def ignore_result(value = true)
14
- @ignore_result_ = value
15
- end
16
-
17
- def retries(value)
18
- @retries_ = value
19
- end
20
-
21
- def abort_others(value = true)
22
- @abort_others_ = value
23
- end
24
- end
25
- end
26
- end
1
+ module JenkinsJob
2
+ module BuildStep
3
+ class PhaseJob < BasicObject
4
+ attr_reader :name, :ignore_result_, :retries_, :abort_others_
5
+
6
+ def initialize(name)
7
+ @name = name
8
+ @ignore_result_ = false
9
+ @retries_ = 0
10
+ @abort_others_ = false
11
+ end
12
+
13
+ def ignore_result(value = true)
14
+ @ignore_result_ = value
15
+ end
16
+
17
+ def retries(value)
18
+ @retries_ = value
19
+ end
20
+
21
+ def abort_others(value = true)
22
+ @abort_others_ = value
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,24 +1,24 @@
1
- module JenkinsJob
2
- module BuildStep
3
- class Shell < BasicObject
4
- attr_reader :cmd_
5
- def initialize(cmd)
6
- @cmd_ = cmd
7
- end
8
- end
9
-
10
- class Batch < BasicObject
11
- attr_reader :cmd_
12
- def initialize(cmd)
13
- @cmd_ = cmd
14
- end
15
- end
16
-
17
- class Powershell < BasicObject
18
- attr_reader :cmd_
19
- def initialize(cmd)
20
- @cmd_ = cmd
21
- end
22
- end
23
- end
24
- end
1
+ module JenkinsJob
2
+ module BuildStep
3
+ class Shell < BasicObject
4
+ attr_reader :cmd_
5
+ def initialize(cmd)
6
+ @cmd_ = cmd
7
+ end
8
+ end
9
+
10
+ class Batch < BasicObject
11
+ attr_reader :cmd_
12
+ def initialize(cmd)
13
+ @cmd_ = cmd
14
+ end
15
+ end
16
+
17
+ class Powershell < BasicObject
18
+ attr_reader :cmd_
19
+ def initialize(cmd)
20
+ @cmd_ = cmd
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,46 +1,46 @@
1
- module JenkinsJob
2
- module BuildStep
3
- class Xvfb < BasicObject
4
- attr_reader :install_name_, :screen_, :debug_, :timeout_, :display_name_offset_, :shutdown_with_build_, :auto_display_name_, :parallel_build_
5
-
6
- def initialize
7
- @install_name_ = 'Xvfb'
8
- @screen_ = '1024x768x24'
9
- @debug_ = false
10
- @timeout_ = 0
11
- @display_name_offset_ = 1
12
- @shutdown_with_build_ = false
13
- @auto_display_name_ = true
14
- @parallel_build_ = false
15
- end
16
-
17
- def install_name(value)
18
- @install_name_ = value
19
- end
20
-
21
- def screen(value)
22
- @screen_ = value
23
- end
24
-
25
- def timeout(value)
26
- @timeout_ = value
27
- end
28
-
29
- def display_name_offset(value)
30
- @display_name_offset_ = value
31
- end
32
-
33
- def shutdown_with_build(value)
34
- @shutdown_with_build_ = value
35
- end
36
-
37
- def auto_display_name(value)
38
- @auto_display_name_ = value
39
- end
40
-
41
- def parallel_build(value)
42
- @parallel_build_ = value
43
- end
44
- end
45
- end
46
- end
1
+ module JenkinsJob
2
+ module BuildStep
3
+ class Xvfb < BasicObject
4
+ attr_reader :install_name_, :screen_, :debug_, :timeout_, :display_name_offset_, :shutdown_with_build_, :auto_display_name_, :parallel_build_
5
+
6
+ def initialize
7
+ @install_name_ = 'Xvfb'
8
+ @screen_ = '1024x768x24'
9
+ @debug_ = false
10
+ @timeout_ = 0
11
+ @display_name_offset_ = 1
12
+ @shutdown_with_build_ = false
13
+ @auto_display_name_ = true
14
+ @parallel_build_ = false
15
+ end
16
+
17
+ def install_name(value)
18
+ @install_name_ = value
19
+ end
20
+
21
+ def screen(value)
22
+ @screen_ = value
23
+ end
24
+
25
+ def timeout(value)
26
+ @timeout_ = value
27
+ end
28
+
29
+ def display_name_offset(value)
30
+ @display_name_offset_ = value
31
+ end
32
+
33
+ def shutdown_with_build(value)
34
+ @shutdown_with_build_ = value
35
+ end
36
+
37
+ def auto_display_name(value)
38
+ @auto_display_name_ = value
39
+ end
40
+
41
+ def parallel_build(value)
42
+ @parallel_build_ = value
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1,33 +1,33 @@
1
- module JenkinsJob
2
- module Common
3
- class Artifactory < BasicObject
4
- attr_reader :server_, :repository_, :deploy_, :resolve_, :build_info_
5
-
6
- def initialize
7
- @deploy_ = []
8
- @resolve_ = []
9
- @build_info_ = false
10
- end
11
-
12
- def server(value)
13
- @server_ = value
14
- end
15
-
16
- def repository(value)
17
- @repository_ = value
18
- end
19
-
20
- def deploy(*value)
21
- @deploy_ = value
22
- end
23
-
24
- def resolve(*value)
25
- @resolve_ = value
26
- end
27
-
28
- def build_info(value = true)
29
- @build_info_ = value
30
- end
31
- end
32
- end
33
- end
1
+ module JenkinsJob
2
+ module Common
3
+ class Artifactory < BasicObject
4
+ attr_reader :server_, :repository_, :deploy_, :resolve_, :build_info_
5
+
6
+ def initialize
7
+ @deploy_ = []
8
+ @resolve_ = []
9
+ @build_info_ = false
10
+ end
11
+
12
+ def server(value)
13
+ @server_ = value
14
+ end
15
+
16
+ def repository(value)
17
+ @repository_ = value
18
+ end
19
+
20
+ def deploy(*value)
21
+ @deploy_ = value
22
+ end
23
+
24
+ def resolve(*value)
25
+ @resolve_ = value
26
+ end
27
+
28
+ def build_info(value = true)
29
+ @build_info_ = value
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,11 +1,11 @@
1
- module JenkinsJob
2
- module Common
3
- class BlockingJob < BasicObject
4
- attr_reader :jobs_
5
-
6
- def initialize(*value)
7
- @jobs_ = value
8
- end
9
- end
10
- end
11
- end
1
+ module JenkinsJob
2
+ module Common
3
+ class BlockingJob < BasicObject
4
+ attr_reader :jobs_
5
+
6
+ def initialize(*value)
7
+ @jobs_ = value
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,23 +1,23 @@
1
- module JenkinsJob
2
- module Common
3
- class BuildTimeout < BasicObject
4
- attr_reader :type_, :timeout_, :elastic_percentage_, :elastic_default_timeout_
5
-
6
- def initialize(type)
7
- @type_ = type
8
- end
9
-
10
- def timeout(value)
11
- @timeout_ = value
12
- end
13
-
14
- def elastic_percentage(value)
15
- @elastic_percentage_ = value
16
- end
17
-
18
- def elastic_default_timeout(value)
19
- @elastic_default_timeout_ = value
20
- end
21
- end
22
- end
23
- end
1
+ module JenkinsJob
2
+ module Common
3
+ class BuildTimeout < BasicObject
4
+ attr_reader :type_, :timeout_, :elastic_percentage_, :elastic_default_timeout_
5
+
6
+ def initialize(type)
7
+ @type_ = type
8
+ end
9
+
10
+ def timeout(value)
11
+ @timeout_ = value
12
+ end
13
+
14
+ def elastic_percentage(value)
15
+ @elastic_percentage_ = value
16
+ end
17
+
18
+ def elastic_default_timeout(value)
19
+ @elastic_default_timeout_ = value
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,53 +1,53 @@
1
- module JenkinsJob
2
- module Common
3
- class Gerrit < BasicObject
4
- attr_reader :change_merged_, :patchset_uploaded_, :comment_added_, :projects_
5
-
6
- def initialize
7
- @comment_added_ = []
8
- @projects_ = []
9
- end
10
-
11
- def change_merged(value = true)
12
- @change_merged_ = value
13
- end
14
-
15
- def patchset_uploaded(value = true)
16
- @patchset_uploaded_ = value
17
- end
18
-
19
- def comment_added(param = {})
20
- param.each do |k, v|
21
- @comment_added_ << {
22
- :approval_category => k,
23
- :approval_value => v
24
- }
25
- end
26
- end
27
-
28
- def project(project, &block)
29
- project = GerritProject.new(project)
30
- project.instance_eval(&block)
31
-
32
- @projects_ << project
33
- end
34
- end
35
-
36
- class GerritProject < BasicObject
37
- attr_reader :project_, :branches_, :files_
38
-
39
- def initialize(project)
40
- @project_ = project
41
- @branches_ = ['**']
42
- end
43
-
44
- def branch(*value)
45
- @branches_ = value
46
- end
47
-
48
- def file(*value)
49
- @files_ = value
50
- end
51
- end
52
- end
53
- end
1
+ module JenkinsJob
2
+ module Common
3
+ class Gerrit < BasicObject
4
+ attr_reader :change_merged_, :patchset_uploaded_, :comment_added_, :projects_
5
+
6
+ def initialize
7
+ @comment_added_ = []
8
+ @projects_ = []
9
+ end
10
+
11
+ def change_merged(value = true)
12
+ @change_merged_ = value
13
+ end
14
+
15
+ def patchset_uploaded(value = true)
16
+ @patchset_uploaded_ = value
17
+ end
18
+
19
+ def comment_added(param = {})
20
+ param.each do |k, v|
21
+ @comment_added_ << {
22
+ :approval_category => k,
23
+ :approval_value => v
24
+ }
25
+ end
26
+ end
27
+
28
+ def project(project, &block)
29
+ project = GerritProject.new(project)
30
+ project.instance_eval(&block)
31
+
32
+ @projects_ << project
33
+ end
34
+ end
35
+
36
+ class GerritProject < BasicObject
37
+ attr_reader :project_, :branches_, :files_
38
+
39
+ def initialize(project)
40
+ @project_ = project
41
+ @branches_ = ['**']
42
+ end
43
+
44
+ def branch(*value)
45
+ @branches_ = value
46
+ end
47
+
48
+ def file(*value)
49
+ @files_ = value
50
+ end
51
+ end
52
+ end
53
+ end