Skip to content

Commit c1301ee

Browse files
author
Randy Coulman
authored
Merge pull request #19 from randycoulman/feat/add-gitlab-notifier
✨ Support gitlab-notifier publisher
2 parents bf5f7ae + 2e90817 commit c1301ee

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

acceptance/fixtures/endToEnd/endToEnd.job

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ job "endToEnd" do |j|
8181
j.publishers << cppcheck(pattern: "PATTERN")
8282
j.publishers << email_ext(recipients: %w{fred barney})
8383
j.publishers << fitnesse(results: "FITNESSE_RESULTS")
84+
j.publishers << gitlab_notifier(name: "GITLAB", mark_unstable_as_success: true)
8485
j.publishers << ircbot(notify_start: true)
8586
j.publishers << junit(results: "RESULTS", keep_long_stdio: false)
8687
j.publishers << trigger(project: "PROJECT")

acceptance/fixtures/endToEnd/expected.yml

+3
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@
135135
- barney
136136
- fitnesse:
137137
results: FITNESSE_RESULTS
138+
- gitlab-notifier:
139+
name: GITLAB
140+
mark-unstable-as-success: true
138141
- ircbot:
139142
notify-start: true
140143
- junit:

lib/jujube/components/publishers.rb

+9
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ module Publishers
4141
# @return [Hash] The specification for the component.
4242
standard_component :fitnesse
4343

44+
# @!method gitlab_notifier(options = {})
45+
# Specify a `gitlab-notifier` publisher for a job.
46+
#
47+
# See {https://docs.openstack.org/infra/jenkins-job-builder/publishers.html#publishers.gitlab-notifier}.
48+
#
49+
# @param options [Hash] The configuration options for the component.
50+
# @return [Hash] The specification for the component.
51+
standard_component :gitlab_notifier
52+
4453
# @!method ircbot(options = {})
4554
# Specify an `ircbot` publisher for a job.
4655
#

test/components/publishers_test.rb

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ def test_fitnesse
2727
assert_equal(expected, fitnesse(results: "RESULTS"))
2828
end
2929

30+
def test_gitlab_notifier
31+
expected = {"gitlab-notifier" => {"name" => "NAME"}}
32+
assert_equal(expected, gitlab_notifier(name: "NAME"))
33+
end
34+
3035
def test_ircbot
3136
expected = {"ircbot" => {"notify-start" => true}}
3237
assert_equal(expected, ircbot(notify_start: true))

0 commit comments

Comments
 (0)