Skip to content

Commit a373571

Browse files
authored
Merge pull request #13 from mroelandts/concurrent_feature
Add concurrent to job definition
2 parents d2228e9 + b5ad947 commit a373571

File tree

6 files changed

+31
-10
lines changed

6 files changed

+31
-10
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ adheres to [Semantic Versioning](http://semver.org/).
55

66
## [Unreleased][unreleased]
77

8+
### Added
9+
10+
* Support the `concurrent` job attribute
11+
(see https://docs.openstack.org/infra/jenkins-job-builder/definition.html?highlight=concurrent).
12+
813
## [0.13.0][0.13.0]
914

1015
### Added

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
![Maintenance Status](https://img.shields.io/badge/maintenance-active-green.svg)
77

88
**Jujube** is a Ruby front-end for
9-
[jenkins-job-builder](https://github.com/openstack-infra/jenkins-job-builder).
9+
[jenkins-job-builder](https://opendev.org/jjb/jenkins-job-builder).
1010

1111
jenkins-job-builder allows you to specify Jenkins jobs in YAML and then creates or
1212
updates the jobs in a running Jenkins instance. It provides some tools for removing
@@ -101,6 +101,7 @@ The following job attributes are supported:
101101
* `block_upstream`
102102
* `block_downstream`
103103
* `quiet_period`
104+
* `concurrent`
104105
* `disabled`
105106

106107
The following sections and components are supported:
@@ -116,7 +117,7 @@ The following sections and components are supported:
116117
`trigger`, `trigger_parameterized_builds`, `unittest`, `xunit`)
117118
* `notifications`: None defined yet
118119

119-
See [the end-to-end example job](examples/fixtures/endToEnd/endToEnd.job) for example
120+
See [the end-to-end example job](acceptance/fixtures/endToEnd/endToEnd.job) for example
120121
uses of all of the supported attributes, sections, and components.
121122

122123
In general, component options are typically specified as standard Ruby hashes. The option

acceptance/fixtures/endToEnd/endToEnd.job

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ job "endToEnd" do |j|
44
j.block_upstream = true
55
j.block_downstream = false
66
j.quiet_period = 42
7+
j.concurrent = true
78
j.disabled = true
89

910
j.axes << slave(:arch, %w{i386 amd64})

acceptance/fixtures/endToEnd/expected.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
block-upstream: true
77
block-downstream: false
88
quiet-period: 42
9+
concurrent: true
910
disabled: true
1011
project-type: matrix
1112
axes:

lib/jujube/job.rb

+16-8
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def initialize(job_name)
2727
# @!attribute name
2828
# The name of the job - will be the name as seen in Jenkins.
2929
#
30-
# See {http://docs.openstack.org/infra/jenkins-job-builder/general.html}.
30+
# See {http://docs.openstack.org/infra/jenkins-job-builder/definition.html}.
3131
#
3232
# @return [String]
3333
attribute :name
@@ -36,55 +36,63 @@ def initialize(job_name)
3636
# The type of job. This normally does not need to be specified, as it
3737
# will be inferred as `matrix` if any `axes` are added.
3838
#
39-
# See {http://docs.openstack.org/infra/jenkins-job-builder/general.html}.
39+
# See {http://docs.openstack.org/infra/jenkins-job-builder/definition.html}.
4040
#
4141
# @return [String]
4242
attribute :project_type
4343

4444
# @!attribute description
4545
# The description of the job.
4646
#
47-
# See {http://docs.openstack.org/infra/jenkins-job-builder/general.html}.
47+
# See {http://docs.openstack.org/infra/jenkins-job-builder/definition.html}.
4848
#
4949
# @return [String]
5050
attribute :description
5151

5252
# @!attribute node
5353
# The Jenkins node or named group where the job should be run.
5454
#
55-
# See {http://docs.openstack.org/infra/jenkins-job-builder/general.html}.
55+
# See {http://docs.openstack.org/infra/jenkins-job-builder/definition.html}.
5656
#
5757
# @return [String]
5858
attribute :node
5959

6060
# @!attribute block_upstream
6161
# `true` if this job should block while upstream jobs are running.
6262
#
63-
# See {http://docs.openstack.org/infra/jenkins-job-builder/general.html}.
63+
# See {http://docs.openstack.org/infra/jenkins-job-builder/definition.html}.
6464
#
6565
# @return [Boolean]
6666
attribute :block_upstream
6767

6868
# @!attribute block_downstream
6969
# `true` if this job should block while downstream jobs are running.
7070
#
71-
# See {http://docs.openstack.org/infra/jenkins-job-builder/general.html}.
71+
# See {http://docs.openstack.org/infra/jenkins-job-builder/definition.html}.
7272
#
7373
# @return [Boolean]
7474
attribute :block_downstream
7575

7676
# @!attribute quiet_period
7777
# Number of seconds to wait between consecutive runs of the job.
7878
#
79-
# See {http://docs.openstack.org/infra/jenkins-job-builder/general.html}.
79+
# See {http://docs.openstack.org/infra/jenkins-job-builder/definition.html}.
8080
#
8181
# @return [Fixnum]
8282
attribute :quiet_period
8383

84+
# @!attribute concurrent
85+
# `true` if this job should be concurrent.
86+
#
87+
# See {https://docs.openstack.org/infra/jenkins-job-builder/definition.html?highlight=concurrent}.
88+
#
89+
# @return [Boolean]
90+
attribute :concurrent
91+
8492
# @!attribute disabled
8593
# `true` if this job should be disabled.
8694
#
87-
# See {http://docs.openstack.org/infra/jenkins-job-builder/general.html}.
95+
# See {http://docs.openstack.org/infra/jenkins-job-builder/definition.html}.
8896
#
8997
# @return [Boolean]
9098
attribute :disabled

test/job_test.rb

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ def test_includes_quiet_period
4040
assert_yaml_matches("quiet-period: 42")
4141
end
4242

43+
def test_includes_concurrent
44+
@job.concurrent = true
45+
assert_yaml_matches("concurrent: true")
46+
end
47+
4348
def test_includes_disabled
4449
@job.disabled = true
4550
assert_yaml_matches("disabled: true")

0 commit comments

Comments
 (0)