add an auth-token YAML parameter for the General Job Configuraion module
Using the Jenkins WEB UI an Authentication Token can be specified for jobs to allow builds to be triggered remotely by using the URL: JENKINS_URL/job/JOBNAME/build?token=TOKEN Add an auth-token job parameter to generate the <authToken> XML element. Change-Id: Ic916e4074c9b2de9c616ef39a88c1d8e1e91fcff Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Reviewed-on: https://review.openstack.org/25819 Reviewed-by: Arnaud Fabre <fabre.arnaud@gmail.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Approved: James E. Blair <corvus@inaugust.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
2cd1e7fb9d
commit
bc235fdfc9
@ -77,6 +77,11 @@ later. There are a few basic optional fields for a Job definition::
|
||||
upstream jobs are running. Upstream jobs are determined
|
||||
transitively. Defaults to ``false``.
|
||||
|
||||
**auth-token**
|
||||
Specifies an authentication token that allows new builds to be
|
||||
triggered by accessing a special predefined URL. Only those who
|
||||
know the token will be able to trigger builds remotely.
|
||||
|
||||
.. _job-template:
|
||||
|
||||
Job Template
|
||||
|
@ -62,5 +62,10 @@ later. There are a few basic optional fields for a Job definition::
|
||||
upstream jobs are running. Upstream jobs are determined
|
||||
transitively. Defaults to ``false``.
|
||||
|
||||
* **auth-token**:
|
||||
Specifies an authentication token that allows new builds to be
|
||||
triggered by accessing a special predefined URL. Only those who
|
||||
know the token will be able to trigger builds remotely.
|
||||
|
||||
.. automodule:: general
|
||||
:members:
|
||||
|
@ -74,6 +74,8 @@ class General(jenkins_jobs.modules.base.Base):
|
||||
else:
|
||||
XML.SubElement(xml,
|
||||
'blockBuildWhenUpstreamBuilding').text = 'false'
|
||||
if 'auth-token' in data:
|
||||
XML.SubElement(xml, 'authToken').text = data['auth-token']
|
||||
if data.get('concurrent'):
|
||||
XML.SubElement(xml, 'concurrentBuild').text = 'true'
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user