Add support for retries options in notifications

Nr of retries options added to Notifications plugin
in commit ee22c8b released in notification-1.12 July 2017.

Change-Id: I3271dfd68cd8d28024af952cda7500d438a2676e
This commit is contained in:
erelk987 2020-11-09 13:54:32 +01:00 committed by Thanh Ha (zxiiro)
parent 09613c84f7
commit 348c93cc7e
4 changed files with 8 additions and 2 deletions

View File

@ -41,9 +41,11 @@ def http_endpoint(registry, xml_parent, data):
:arg str event: job events that trigger notifications: started, :arg str event: job events that trigger notifications: started,
completed, finalized or all (default) completed, finalized or all (default)
:arg str url: URL of the endpoint :arg str url: URL of the endpoint
:arg str timeout: Timeout in milliseconds for sending notification :arg int timeout: Timeout in milliseconds for sending notification
request (30 seconds by default) request (30 seconds by default)
:arg str log: Number lines of log messages to send (0 by default). :arg int retries: Nr of times to retry sending notification in case
sending notification fails. (0 by default)
:arg int log: Number lines of log messages to send (0 by default).
Use -1 for all (use with caution). Use -1 for all (use with caution).
Example: Example:
@ -65,6 +67,7 @@ def http_endpoint(registry, xml_parent, data):
("", "protocol", "HTTP"), ("", "protocol", "HTTP"),
("", "event", event, supported_events), ("", "event", event, supported_events),
("timeout", "timeout", 30000), ("timeout", "timeout", 30000),
("retries", "retries", 0),
("url", "url", None), ("url", "url", None),
("log", "loglines", 0), ("log", "loglines", 0),
] ]

View File

@ -8,6 +8,7 @@
<protocol>HTTP</protocol> <protocol>HTTP</protocol>
<event>all</event> <event>all</event>
<timeout>30000</timeout> <timeout>30000</timeout>
<retries>0</retries>
<url>http://example.com/jenkins_endpoint</url> <url>http://example.com/jenkins_endpoint</url>
<loglines>0</loglines> <loglines>0</loglines>
</com.tikal.hudson.plugins.notification.Endpoint> </com.tikal.hudson.plugins.notification.Endpoint>

View File

@ -8,6 +8,7 @@
<protocol>HTTP</protocol> <protocol>HTTP</protocol>
<event>completed</event> <event>completed</event>
<timeout>40000</timeout> <timeout>40000</timeout>
<retries>5</retries>
<url>http://example.com/jenkins_endpoint</url> <url>http://example.com/jenkins_endpoint</url>
<loglines>-1</loglines> <loglines>-1</loglines>
</com.tikal.hudson.plugins.notification.Endpoint> </com.tikal.hudson.plugins.notification.Endpoint>

View File

@ -5,3 +5,4 @@ notifications:
event: completed event: completed
timeout: 40000 timeout: 40000
log: -1 log: -1
retries: 5