Add support for Copy Artifact project copy permissions
Since 1.30, Copy Artifact supports specifing the projects that are allowed to copy artifacts for a given project in the general job properties. Change-Id: I5a9de21f449e98d08ec9303d55021d6a661257d4
This commit is contained in:
parent
1441ebf485
commit
01ec946812
@ -475,6 +475,36 @@ def build_blocker(parser, xml_parent, data):
|
||||
XML.SubElement(blocker, 'blockingJobs').text = jobs
|
||||
|
||||
|
||||
def copyartifact(parser, xml_parent, data):
|
||||
"""yaml: copyartifact
|
||||
Specify a list of projects that have access to copy the artifacts of
|
||||
this project.
|
||||
|
||||
Requires the Jenkins `Copy Artifact plugin.
|
||||
<https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin>`_
|
||||
|
||||
:arg string projects: comma separated list of projects that can copy
|
||||
artifacts of this project. Wild card character '*' is available.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
.. literalinclude:: \
|
||||
/../../tests/properties/fixtures/copyartifact.yaml
|
||||
|
||||
"""
|
||||
copyartifact = XML.SubElement(xml_parent,
|
||||
'hudson.plugins.'
|
||||
'copyartifact.'
|
||||
'CopyArtifactPermissionProperty',
|
||||
plugin='copyartifact')
|
||||
if not data or not data.get('projects', None):
|
||||
raise JenkinsJobsException("projects string must exist and "
|
||||
"not be empty")
|
||||
projectlist = XML.SubElement(copyartifact, 'projectNameList')
|
||||
XML.SubElement(projectlist, 'string').text = data.get('projects')
|
||||
|
||||
|
||||
def batch_tasks(parser, xml_parent, data):
|
||||
"""yaml: batch-tasks
|
||||
Batch tasks can be tasks for events like releases, integration, archiving,
|
||||
|
@ -59,6 +59,7 @@ jenkins_jobs.properties =
|
||||
batch-tasks=jenkins_jobs.modules.properties:batch_tasks
|
||||
build-blocker=jenkins_jobs.modules.properties:build_blocker
|
||||
builds-chain-fingerprinter=jenkins_jobs.modules.properties:builds_chain_fingerprinter
|
||||
copyartifact=jenkins_jobs.modules.properties:copyartifact
|
||||
delivery-pipeline=jenkins_jobs.modules.properties:delivery_pipeline
|
||||
extended-choice=jenkins_jobs.modules.properties:extended_choice
|
||||
github=jenkins_jobs.modules.properties:github
|
||||
|
10
tests/properties/fixtures/copyartifact.xml
Normal file
10
tests/properties/fixtures/copyartifact.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<properties>
|
||||
<hudson.plugins.copyartifact.CopyArtifactPermissionProperty plugin="copyartifact">
|
||||
<projectNameList>
|
||||
<string>foo*</string>
|
||||
</projectNameList>
|
||||
</hudson.plugins.copyartifact.CopyArtifactPermissionProperty>
|
||||
</properties>
|
||||
</project>
|
3
tests/properties/fixtures/copyartifact.yaml
Normal file
3
tests/properties/fixtures/copyartifact.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
properties:
|
||||
- copyartifact:
|
||||
projects: foo*
|
Loading…
Reference in New Issue
Block a user