From 1300071f9257efb11a76574d17f27bd37d87166b Mon Sep 17 00:00:00 2001 From: Yolande Amate Date: Mon, 24 Jul 2017 23:45:59 +0100 Subject: [PATCH] Add support for new parameter option in Slack Plugin Change-Id: Ic827d8ee9de057f535fa2b95ab7a7aaa7bc20fee Task: 3457 story: 2000850 --- jenkins_jobs/modules/publishers.py | 5 ++++- tests/publishers/fixtures/slack001.xml | 1 + tests/publishers/fixtures/slack001.yaml | 1 + tests/publishers/fixtures/slack002.xml | 1 + tests/publishers/fixtures/slack002.yaml | 1 + tests/publishers/fixtures/slack003.xml | 1 + tests/publishers/fixtures/slack004.xml | 1 + tests/publishers/fixtures/slack004.yaml | 1 + 8 files changed, 11 insertions(+), 1 deletion(-) diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 30ae3d870..431a5bbf9 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -6481,6 +6481,8 @@ def slack(registry, xml_parent, data): :arg str team-domain: Your team's domain at slack. (default '') :arg str auth-token: The integration token to be used when sending notifications. (default '') + :arg str auth-token-id: Allows credentials to be stored in Jenkins. + (default '') :arg str build-server-url: Specify the URL for your server installation. (default '/') :arg str room: A comma seperated list of rooms / channels to post the @@ -6497,7 +6499,7 @@ def slack(registry, xml_parent, data): (>=2.0). (default false) :arg bool notify-failure: Send notification when job fails for the first time (previous build was a success) (>=2.0). (default false) - :arg bool notifiy-back-to-normal: Send notification when job is succeeding + :arg bool notify-back-to-normal: Send notification when job is succeeding again after being unstable or failed (>=2.0). (default false) :arg bool notify-repeated-failure: Send notification when job fails successively (previous build was also a failure) (>=2.0). @@ -6545,6 +6547,7 @@ def slack(registry, xml_parent, data): mapping = ( ('team-domain', 'teamDomain', ''), ('auth-token', 'authToken', ''), + ('auth-token-id', 'authTokenCredentialId', ''), ('build-server-url', 'buildServerUrl', '/'), ('room', 'room', ''), ) diff --git a/tests/publishers/fixtures/slack001.xml b/tests/publishers/fixtures/slack001.xml index 4aec2d4f8..fec27adac 100644 --- a/tests/publishers/fixtures/slack001.xml +++ b/tests/publishers/fixtures/slack001.xml @@ -4,6 +4,7 @@ teamname yourauthtoken + yourauthtokenid / #builds diff --git a/tests/publishers/fixtures/slack001.yaml b/tests/publishers/fixtures/slack001.yaml index a4fb5aa40..2b7992b78 100644 --- a/tests/publishers/fixtures/slack001.yaml +++ b/tests/publishers/fixtures/slack001.yaml @@ -3,3 +3,4 @@ publishers: room: '#builds' team-domain: 'teamname' auth-token: 'yourauthtoken' + auth-token-id: 'yourauthtokenid' diff --git a/tests/publishers/fixtures/slack002.xml b/tests/publishers/fixtures/slack002.xml index 3c62ba0b4..14f18d354 100644 --- a/tests/publishers/fixtures/slack002.xml +++ b/tests/publishers/fixtures/slack002.xml @@ -4,6 +4,7 @@ teamname yourauthtoken + yourauthtokenid http://localhost:8081 #builds diff --git a/tests/publishers/fixtures/slack002.yaml b/tests/publishers/fixtures/slack002.yaml index 4c84be313..440d6da17 100644 --- a/tests/publishers/fixtures/slack002.yaml +++ b/tests/publishers/fixtures/slack002.yaml @@ -3,4 +3,5 @@ publishers: room: '#builds' team-domain: 'teamname' auth-token: 'yourauthtoken' + auth-token-id: 'yourauthtokenid' build-server-url: 'http://localhost:8081' diff --git a/tests/publishers/fixtures/slack003.xml b/tests/publishers/fixtures/slack003.xml index a9045e751..da2e3462b 100644 --- a/tests/publishers/fixtures/slack003.xml +++ b/tests/publishers/fixtures/slack003.xml @@ -4,6 +4,7 @@ + / false diff --git a/tests/publishers/fixtures/slack004.xml b/tests/publishers/fixtures/slack004.xml index 1c6c6ca67..5363fb083 100644 --- a/tests/publishers/fixtures/slack004.xml +++ b/tests/publishers/fixtures/slack004.xml @@ -4,6 +4,7 @@ teamname yourauthtoken + yourauthtokenid http://localhost:8081 #builds true diff --git a/tests/publishers/fixtures/slack004.yaml b/tests/publishers/fixtures/slack004.yaml index 54cc90df2..e6bae3582 100644 --- a/tests/publishers/fixtures/slack004.yaml +++ b/tests/publishers/fixtures/slack004.yaml @@ -2,6 +2,7 @@ publishers: - slack: team-domain: 'teamname' auth-token: 'yourauthtoken' + auth-token-id: 'yourauthtokenid' build-server-url: 'http://localhost:8081' room: '#builds' notify-start: True