Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Commit

Permalink
CD-3582: Add Support for Google Chat Notification Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
oswalpalash committed Jan 17, 2019
1 parent 1e639a1 commit a0bfb0c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ A number of the DSL options rely on Jenkins plugins, including:
* ansicolor - "AnsiColor"
* (view) type: 'categorizedView' - "categorized-view"
* hipchat - "HipChat Plugin"
* google_chat - "google-chat-notification-plugin"
* inject_env_vars - "Environment Injector Plugin"
* priority - "Priority Sorter plugin"
* downstream - "Parameterized Trigger plugin"
Expand Down
23 changes: 23 additions & 0 deletions lib/jenkins_pipeline_builder/extensions/job_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,29 @@
end
end

job_attribute do
name :google_chat
plugin_id 'google-chat-notification'
description 'This plugin allows your team to setup build notifications to be sent to Google Chat rooms.'
jenkins_name 'Google Chat Notification'
announced false

xml path: '//properties' do |params|
send('io.cnaik.GoogleChatNotification', 'plugin' => 'google-chat-notification') do
url params[:url] || ''
notifyAborted params[:notifyAborted] || false
notifyFailure params[:notifyFailure] || false
notifyNotBuilt params[:notifyNotBuilt] || false
notifySuccess params[:notifySuccess] || false
notifyUnstable params[:notifyUnstable] || false
notifyBackToNormal params[:notifyBackToNormal] || false
suppressInfoLoggers params[:suppressInfoLoggers] || false
sameThreadNotification params[:sameThreadNotification] || false
message params[:message] || ''
end
end
end

job_attribute do
name :hipchat
plugin_id 'hipchat'
Expand Down
26 changes: 26 additions & 0 deletions lib/jenkins_pipeline_builder/extensions/publishers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,32 @@
end
end

publisher do
name :google_chat
plugin_id 'google-chat-notification'
description 'This plugin allows your team to setup build notifications to be sent to Google Chat rooms.'
jenkins_name 'Google Chat Notification'
announced false

version '0' do
xml do |params|
params = {} if params == true
send('io.cnaik.GoogleChatNotification') do
url params[:url] || ''
message params[:message] || ''
notifyAborted params[:notifyAborted] || false
notifyFailure params[:notifyFailure] || false
notifyNotBuilt params[:notifyNotBuilt] || false
notifySuccess params[:notifySuccess] || false
notifyUnstable params[:notifyUnstable] || false
notifyBackToNormal params[:notifyBackToNormal] || false
suppressInfoLoggers params[:suppressInfoLoggers] || false
sameThreadNotification params[:sameThreadNotification] || false
end
end
end
end

publisher do
name :hipchat
plugin_id 'hipchat'
Expand Down

0 comments on commit a0bfb0c

Please sign in to comment.