Class: Jujube::Job
Overview
Models a single Jenkins job.
Attributes collapse
-
#block_downstream ⇒ Boolean
true
if this job should block while downstream jobs are running. -
#block_upstream ⇒ Boolean
true
if this job should block while upstream jobs are running. -
#concurrent ⇒ Boolean
true
if this job should be concurrent. -
#description ⇒ String
The description of the job.
-
#disabled ⇒ Boolean
true
if this job should be disabled. -
#name ⇒ String
The name of the job - will be the name as seen in Jenkins.
-
#node ⇒ String
The Jenkins node or named group where the job should be run.
-
#project_type ⇒ String
The type of job.
-
#quiet_period ⇒ Fixnum
Number of seconds to wait between consecutive runs of the job.
Sections collapse
-
#axes ⇒ Array
The matrix axes for the job.
-
#builders ⇒ Array
The builders for the job.
-
#notifications ⇒ Array
The notifications for the job.
-
#parameters ⇒ Array
The parameters for the job.
-
#properties ⇒ Array
The Properties for the job.
-
#publishers ⇒ Array
The publishers for the job.
-
#scm ⇒ Array
The SCMs for the job.
-
#triggers ⇒ Array
The triggers for the job.
-
#wrappers ⇒ Array
The wrappers for the job.
Class Method Summary collapse
-
.all_defined_during ⇒ Array<Job>
Keep track of all
Job
s defined during the execution of the passed block. -
.register(job) ⇒ Object
Register a
Job
in a registry.
Instance Method Summary collapse
-
#initialize(job_name) {|self| ... } ⇒ Job
constructor
Initialize the job.
-
#to_h ⇒ Object
Generate a
Hash
repsentation of theJob
. -
#to_yaml(*args) ⇒ Object
Generate a YAML representation of the
Job
.
Methods included from Macros
Constructor Details
#initialize(job_name) {|self| ... } ⇒ Job
Initialize the job.
Takes a configuration block for adding atributes and sections to the job.
The configuration block is passed the new Job
as a parameter.
16 17 18 19 20 21 22 23 |
# File 'lib/jujube/job.rb', line 16 def initialize(job_name) @config = {} self.name = job_name yield(self) if block_given? self.class.register(self) end |
Instance Attribute Details
#block_downstream ⇒ Boolean
true
if this job should block while downstream jobs are running.
See https://jenkins-job-builder.readthedocs.io/en/latest/definition.html.
74 |
# File 'lib/jujube/job.rb', line 74 attribute :block_downstream |
#block_upstream ⇒ Boolean
true
if this job should block while upstream jobs are running.
See https://jenkins-job-builder.readthedocs.io/en/latest/definition.html.
66 |
# File 'lib/jujube/job.rb', line 66 attribute :block_upstream |
#concurrent ⇒ Boolean
true
if this job should be concurrent.
See https://jenkins-job-builder.readthedocs.io/en/latest/definition.html?highlight=concurrent.
90 |
# File 'lib/jujube/job.rb', line 90 attribute :concurrent |
#description ⇒ String
The description of the job.
See https://jenkins-job-builder.readthedocs.io/en/latest/definition.html.
50 |
# File 'lib/jujube/job.rb', line 50 attribute :description |
#disabled ⇒ Boolean
true
if this job should be disabled.
See https://jenkins-job-builder.readthedocs.io/en/latest/definition.html.
98 |
# File 'lib/jujube/job.rb', line 98 attribute :disabled |
#name ⇒ String
The name of the job - will be the name as seen in Jenkins.
See https://jenkins-job-builder.readthedocs.io/en/latest/definition.html.
33 |
# File 'lib/jujube/job.rb', line 33 attribute :name |
#node ⇒ String
The Jenkins node or named group where the job should be run.
See https://jenkins-job-builder.readthedocs.io/en/latest/definition.html.
58 |
# File 'lib/jujube/job.rb', line 58 attribute :node |
#project_type ⇒ String
The type of job. This normally does not need to be specified, as it
will be inferred as matrix
if any axes
are added.
See https://jenkins-job-builder.readthedocs.io/en/latest/definition.html.
42 |
# File 'lib/jujube/job.rb', line 42 attribute :project_type |
#quiet_period ⇒ Fixnum
Number of seconds to wait between consecutive runs of the job.
See https://jenkins-job-builder.readthedocs.io/en/latest/definition.html.
82 |
# File 'lib/jujube/job.rb', line 82 attribute :quiet_period |
Class Method Details
.all_defined_during ⇒ Array<Job>
Keep track of all Job
s defined during the execution of the passed block.
This is used during job loading so that no extra syntax is required in the job definition files for registering jobs and so that it is possible to create jobs for testing purposes without having them registered anywhere.
230 231 232 233 234 235 236 |
# File 'lib/jujube/job.rb', line 230 def self.all_defined_during @registry = [] yield @registry ensure @registry = [] end |
Instance Method Details
#axes ⇒ Array
The matrix axes for the job.
Add axes in the job's configuration block using helper methods defined in Components::Parameters.
See https://jenkins-job-builder.readthedocs.io/en/latest/project_matrix.html.
118 |
# File 'lib/jujube/job.rb', line 118 section :axes |
#builders ⇒ Array
The builders for the job.
Add builders in the job's configuration block using helper methods defined in Components::Builders.
See https://jenkins-job-builder.readthedocs.io/en/latest/builders.html.
184 |
# File 'lib/jujube/job.rb', line 184 section :builders |
#notifications ⇒ Array
The notifications for the job.
Add notifications in the job's configuration block using helper methods defined in Components::Notifications.
See https://jenkins-job-builder.readthedocs.io/en/latest/notifications.html.
206 |
# File 'lib/jujube/job.rb', line 206 section :notifications |
#parameters ⇒ Array
The parameters for the job.
Add parameters in the job's configuration block using helper methods defined in Components::Parameters.
See https://jenkins-job-builder.readthedocs.io/en/latest/parameters.html.
129 |
# File 'lib/jujube/job.rb', line 129 section :parameters |
#properties ⇒ Array
The Properties for the job.
Add properties in the job's configuration block using helper methods defined in Components::Properties.
See https://jenkins-job-builder.readthedocs.io/en/latest/properties.html.
140 |
# File 'lib/jujube/job.rb', line 140 section :properties |
#publishers ⇒ Array
The publishers for the job.
Add publishers in the job's configuration block using helper methods defined in Components::Publishers.
See https://jenkins-job-builder.readthedocs.io/en/latest/publishers.html.
195 |
# File 'lib/jujube/job.rb', line 195 section :publishers |
#scm ⇒ Array
The SCMs for the job.
Add SCMs in the job's configuration block using helper methods defined in Components::Scm.
See https://jenkins-job-builder.readthedocs.io/en/latest/scm.html.
151 |
# File 'lib/jujube/job.rb', line 151 section :scm |
#to_h ⇒ Object
Generate a Hash
repsentation of the Job
.
216 217 218 219 |
# File 'lib/jujube/job.rb', line 216 def to_h infer_project_type {'job' => config} end |
#to_yaml(*args) ⇒ Object
Generate a YAML representation of the Job
.
211 212 213 |
# File 'lib/jujube/job.rb', line 211 def to_yaml(*args) to_h.to_yaml(*args) end |
#triggers ⇒ Array
The triggers for the job.
Add triggers in the job's configuration block using helper methods defined in Components::Triggers.
See https://jenkins-job-builder.readthedocs.io/en/latest/triggers.html.
162 |
# File 'lib/jujube/job.rb', line 162 section :triggers |
#wrappers ⇒ Array
The wrappers for the job.
Add wrappers in the job's configuration block using helper methods defined in Components::Wrappers.
See https://jenkins-job-builder.readthedocs.io/en/latest/wrappers.html.
173 |
# File 'lib/jujube/job.rb', line 173 section :wrappers |