Module: Jujube::Components::Triggers
- Included in:
- Jujube::Components
- Defined in:
- lib/jujube/components/triggers.rb
Overview
Helper methods for creating trigger components.
pollurl Helpers collapse
-
#url(the_url, options = {}) {|content_types| ... } ⇒ Hash
Configure a URL to poll in a #pollurl component.
pollurl Content Types collapse
Instance Method Summary collapse
-
#pollscm(interval) ⇒ Hash
Specify a
pollscmtrigger for a job. -
#pollurl(options = {}) {|urls| ... } ⇒ Hash
Specify a
pollurltrigger for a job. -
#reverse(options = {}) ⇒ Hash
Specify a
reversetrigger for a job.
Instance Method Details
#json(*paths) ⇒ Hash
93 94 95 |
# File 'lib/jujube/components/triggers.rb', line 93 def json(*paths) {"json" => paths} end |
#pollscm(interval) ⇒ Hash
Specify a pollscm trigger for a job.
See http://ci.openstack.org/jenkins-job-builder/triggers.html#triggers.pollscm.
13 14 15 |
# File 'lib/jujube/components/triggers.rb', line 13 def pollscm(interval) {'pollscm' => interval} end |
#pollurl(options = {}) {|urls| ... } ⇒ Hash
Specify a pollurl trigger for a job.
This trigger requires support in jenkins-job-builder that has not yet been merged. See https://review.openstack.org/83524/ for the patch.
pollurl can poll several URLs. Each URL specification is added
in a nested configuration block using the #url method.
38 39 40 |
# File 'lib/jujube/components/triggers.rb', line 38 def pollurl( = {}, &block) to_config("pollurl", (:urls, , &block)) end |
#reverse(options = {}) ⇒ Hash
Specify a reverse trigger for a job.
See http://ci.openstack.org/jenkins-job-builder/triggers.html#triggers.reverse.
53 54 55 56 |
# File 'lib/jujube/components/triggers.rb', line 53 def reverse( = {}) formatted_jobs = Array([:jobs]).join(", ") to_config("reverse", .merge(jobs: formatted_jobs)) end |
#simple ⇒ Hash
83 84 85 |
# File 'lib/jujube/components/triggers.rb', line 83 def simple {"simple" => true} end |
#text(*regexes) ⇒ Hash
113 114 115 |
# File 'lib/jujube/components/triggers.rb', line 113 def text(*regexes) {"text" => regexes} end |
#url(the_url, options = {}) {|content_types| ... } ⇒ Hash
71 72 73 74 |
# File 'lib/jujube/components/triggers.rb', line 71 def url(the_url, = {}, &block) = {url: the_url}.merge!() ((:check_content, , &block)) end |