aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <paul.sokolovsky@linaro.org>2015-04-30 14:06:05 +0300
committerPaul Sokolovsky <paul.sokolovsky@linaro.org>2015-05-11 13:35:10 +0300
commitdffccb0b264d76027ef134a71620d3dc551bc8f8 (patch)
treef8082210fadc139bd4d64e8d4a93e7a569e3b67d
parent704bfe0f3bb10df23c2a53b91dc554be2771f040 (diff)
downloadjjb-linaro-plugin-master.tar.gz
linaro-publish-token: Accept "host" parameter.HEAD1.1master
To support multiple destination servers, as allowed by Jenkins Linaro PubAPI Plugin 1.2. It's value should be destination host's Credential ID as configured in Jenkins Credentials section (it's recommended to use host name as an ID to avoid confusion). The parameter is optional for backward compatibility. Change-Id: Ife72b212cc72372989a03f0647f18b5e6aaee50c
-rw-r--r--jenkins_jobs_linaro/modules/linaro.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/jenkins_jobs_linaro/modules/linaro.py b/jenkins_jobs_linaro/modules/linaro.py
index 860eb3d..0dee847 100644
--- a/jenkins_jobs_linaro/modules/linaro.py
+++ b/jenkins_jobs_linaro/modules/linaro.py
@@ -26,6 +26,13 @@ def linaro_pub_token(parser, xml_parent, data):
"""yaml: linaro-publish-token
Get one-time publishing token for Linaro Publishing API.
Requires the Jenkins Linaro Publishing API plugin.
+
+ :arg str host: Destination server, identified by a Credentials ID as configured
+ in Jenkins Credentials Subsystem.
"""
- XML.SubElement(xml_parent,
+ pubapi = XML.SubElement(xml_parent,
'linaro.pubapi.LinaroPubAPIKey')
+ # Default value to transparently support job config for 1.1 plugin which
+ # didn't support multiple servers.
+ cid = data.get('host', 'snapshots.linaro.org')
+ XML.SubElement(pubapi, 'credentialsId').text = cid