From: Eric Ball Date: Fri, 10 Sep 2021 21:29:07 +0000 (-0700) Subject: Fix: Make archiveArtifacts overwriteable in lfJava X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=da7d0750ca17229176e107b5d13c048680f0364f;p=releng%2Fpipelines.git Fix: Make archiveArtifacts overwriteable in lfJava While we have the correct default value here, this should not be hard-coded. It is now treated as a default local to lfJava, but can still be passed in as an optional parameter, in which case the default will be overwritten. Issue: RELENG-3938 Signed-off-by: Eric Ball Change-Id: Ic57d8f7ad8005418a7b687bbef63c9cc02db6102 --- diff --git a/docs/vars/lfJava.rst b/docs/vars/lfJava.rst index 8e4e327..b54c4a5 100644 --- a/docs/vars/lfJava.rst +++ b/docs/vars/lfJava.rst @@ -15,6 +15,7 @@ Parameters :mvnGlobalSettings: Override default global-settings filename :mvnGoals: String with maven goals to execute :mvnVersion: Maven version to use in build + :archiveArtifacts: Newline-separated list of paths to archive. Usage ===== diff --git a/vars/lfJava.groovy b/vars/lfJava.groovy index dca9d1a..70f0430 100644 --- a/vars/lfJava.groovy +++ b/vars/lfJava.groovy @@ -18,11 +18,18 @@ * Method to run Java jobs. * Required body values: * * mvnSettings: Maven settings config file ID - * Optional body values (should be defined in lfDefaults): - * * javaVersion - * * mvnGlobalSettings - * * mvnGoals - * * mvnVersion + * Optional body values: + * * javaVersion (default: "openjdk11") + * * mvnGlobalSettings (default: "global-settings") + * * mvnGoals (default: "clean install") + * * mvnVersion (default: "mvn35") + * * archiveArtifacts (default: + * """**\/*.log + * **\/hs_err_*.log + * **\/target/**\/feature.xml + * **\/target/failsafe-reports/failsafe-summary.xml + * *\/target/surefire-reports/*-output.txt""" + * ) * * @param body Config values to be provided in the form "key = value". */ @@ -30,6 +37,12 @@ def call(body) { // Evaluate the body block and collect configuration into the object def defaults = lfDefaults() def config = [:] + // Set default archiveArtifacts for Maven builds. + defaults.archiveArtifacts = """**/*.log +**/hs_err_*.log +**/target/**/feature.xml +**/target/failsafe-reports/failsafe-summary.xml +**/target/surefire-reports/*-output.txt""" if (body) { body.resolveStrategy = Closure.DELEGATE_FIRST @@ -45,15 +58,6 @@ def call(body) { "required for lfJava function.") } - //////////////////////// - // Default parameters // - //////////////////////// - archiveArtifacts = """**/*.log -**/hs_err_*.log -**/target/**/feature.xml -**/target/failsafe-reports/failsafe-summary.xml -**/target/surefire-reports/*-output.txt""" - lfCommon.installPythonTools() lfCommon.jacocoNojava()