diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index e2880fd83..07832e9bb 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -55,14 +55,16 @@ def archive(parser, xml_parent, data): Archive build artifacts :arg str artifacts: path specifier for artifacts to archive - :arg str excludes: path specifier for artifacts to exclude + :arg str excludes: path specifier for artifacts to exclude (optional) :arg bool latest-only: only keep the artifacts from the latest - successful build + successful build :arg bool allow-empty: pass the build if no artifacts are - found (default false) + found (default false) :arg bool only-if-success: archive artifacts only if build is successful - (default false) + (default false) :arg bool fingerprint: fingerprint all archived artifacts (default false) + :arg bool default-excludes: This option allows to enable or disable the + default Ant exclusions. (default true) Example: @@ -101,6 +103,9 @@ def archive(parser, xml_parent, data): fingerprint = XML.SubElement(archiver, 'fingerprint') fingerprint.text = str(data.get('fingerprint', False)).lower() + default_excludes = XML.SubElement(archiver, 'defaultExcludes') + default_excludes.text = str(data.get('default-excludes', True)).lower() + def blame_upstream(parser, xml_parent, data): """yaml: blame-upstream diff --git a/tests/publishers/fixtures/archive001.xml b/tests/publishers/fixtures/archive001.xml index a9c2c5550..7c49faefe 100644 --- a/tests/publishers/fixtures/archive001.xml +++ b/tests/publishers/fixtures/archive001.xml @@ -6,6 +6,7 @@ <latestOnly>false</latestOnly> <allowEmptyArchive>true</allowEmptyArchive> <fingerprint>true</fingerprint> + <defaultExcludes>false</defaultExcludes> </hudson.tasks.ArtifactArchiver> </publishers> </project> diff --git a/tests/publishers/fixtures/archive001.yaml b/tests/publishers/fixtures/archive001.yaml index bb185267e..ce389a6d4 100644 --- a/tests/publishers/fixtures/archive001.yaml +++ b/tests/publishers/fixtures/archive001.yaml @@ -3,3 +3,4 @@ publishers: artifacts: '*.tar.gz' allow-empty: 'true' fingerprint: true + default-excludes: false diff --git a/tests/publishers/fixtures/archive002.xml b/tests/publishers/fixtures/archive002.xml index 3ec767384..f06accfee 100644 --- a/tests/publishers/fixtures/archive002.xml +++ b/tests/publishers/fixtures/archive002.xml @@ -7,6 +7,7 @@ <allowEmptyArchive>true</allowEmptyArchive> <onlyIfSuccessful>true</onlyIfSuccessful> <fingerprint>true</fingerprint> + <defaultExcludes>true</defaultExcludes> </hudson.tasks.ArtifactArchiver> </publishers> </project> diff --git a/tests/publishers/fixtures/archive003.xml b/tests/publishers/fixtures/archive003.xml index 621c4ed67..ecfff76ab 100644 --- a/tests/publishers/fixtures/archive003.xml +++ b/tests/publishers/fixtures/archive003.xml @@ -7,6 +7,7 @@ <allowEmptyArchive>true</allowEmptyArchive> <onlyIfSuccessful>false</onlyIfSuccessful> <fingerprint>true</fingerprint> + <defaultExcludes>true</defaultExcludes> </hudson.tasks.ArtifactArchiver> </publishers> </project> diff --git a/tests/publishers/fixtures/conditional-publisher001.xml b/tests/publishers/fixtures/conditional-publisher001.xml index 2e10c6b65..99b324350 100644 --- a/tests/publishers/fixtures/conditional-publisher001.xml +++ b/tests/publishers/fixtures/conditional-publisher001.xml @@ -23,6 +23,7 @@ <artifacts>**/**</artifacts> <latestOnly>false</latestOnly> <allowEmptyArchive>true</allowEmptyArchive> + <defaultExcludes>true</defaultExcludes> </publisher> </org.jenkins__ci.plugins.flexible__publish.ConditionalPublisher> </publishers> diff --git a/tests/publishers/fixtures/conditional-publisher003.xml b/tests/publishers/fixtures/conditional-publisher003.xml index 16cc8f3cd..46197b9e2 100644 --- a/tests/publishers/fixtures/conditional-publisher003.xml +++ b/tests/publishers/fixtures/conditional-publisher003.xml @@ -11,6 +11,7 @@ <artifacts>**/**</artifacts> <latestOnly>false</latestOnly> <allowEmptyArchive>true</allowEmptyArchive> + <defaultExcludes>true</defaultExcludes> </hudson.tasks.ArtifactArchiver> <hudson.tasks.test.AggregatedTestResultPublisher> <includeFailedBuilds>true</includeFailedBuilds> diff --git a/tests/publishers/fixtures/conditional-publisher004.xml b/tests/publishers/fixtures/conditional-publisher004.xml index 773cb4c6f..fec92f7dd 100644 --- a/tests/publishers/fixtures/conditional-publisher004.xml +++ b/tests/publishers/fixtures/conditional-publisher004.xml @@ -13,6 +13,7 @@ <artifacts>**/**</artifacts> <latestOnly>false</latestOnly> <allowEmptyArchive>true</allowEmptyArchive> + <defaultExcludes>true</defaultExcludes> </publisher> </org.jenkins__ci.plugins.flexible__publish.ConditionalPublisher> </publishers>