Add fingerprint parameter to archive publisher.

In Jenkins 1.575 the option to fingerprint build artefacts has been
moved from Fingerprinter to ArtifactArchiver.
(https://github.com/jenkinsci/jenkins/commit/f43a450)

This patch reflects the change by adding an optional fingerprint
parameter to the archive publisher. The parameter recordBuildArtifacts
in the fingerprint publisher remains unchanged for backward
compatibility.

Change-Id: I231fdc38eb8343d646f24e7a31cafd29534c9fc8
This commit is contained in:
Christian Fetzer 2014-11-07 16:37:11 +01:00
parent 8dfc883477
commit a352c824bc
3 changed files with 7 additions and 0 deletions

View File

@ -45,6 +45,7 @@ def archive(parser, xml_parent, data):
successful build
:arg bool allow-empty: pass the build if no artifacts are
found (default false)
:arg bool fingerprint: fingerprint all archived artifacts (default false)
Example:
@ -75,6 +76,10 @@ def archive(parser, xml_parent, data):
# Default behavior is to fail the build.
empty.text = str(data.get('allow-empty', False)).lower()
if 'fingerprint' in data:
fingerprint = XML.SubElement(archiver, 'fingerprint')
fingerprint.text = str(data.get('fingerprint', False)).lower()
def blame_upstream(parser, xml_parent, data):
"""yaml: blame-upstream

View File

@ -5,6 +5,7 @@
<artifacts>*.tar.gz</artifacts>
<latestOnly>false</latestOnly>
<allowEmptyArchive>true</allowEmptyArchive>
<fingerprint>true</fingerprint>
</hudson.tasks.ArtifactArchiver>
</publishers>
</project>

View File

@ -2,3 +2,4 @@ publishers:
- archive:
artifacts: '*.tar.gz'
allow-empty: 'true'
fingerprint: true