From: Jessica Wagantall Date: Sat, 27 Jul 2019 02:08:16 +0000 (-0700) Subject: Extend sonatype-clm.sh goals X-Git-Tag: v0.40.0~4^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=6c2d75d8776959527346a9ea5095e4b0228adc70;p=releng%2Fglobal-jjb.git Extend sonatype-clm.sh goals Allow to configure maven goals in lf-maven-clm to allow running test in some projects. Issue: RELENG-2236 Change-Id: I83c0efb8b3749483554bf4c1db04ea77c2d17cd7 Signed-off-by: Jessica Wagantall --- diff --git a/docs/jjb/lf-maven-jobs.rst b/docs/jjb/lf-maven-jobs.rst index fd0b8908..bdee524a 100644 --- a/docs/jjb/lf-maven-jobs.rst +++ b/docs/jjb/lf-maven-jobs.rst @@ -96,6 +96,16 @@ Setup Java alternatives for the Distro. :java-version: Version of Java to set as the default Java. Eg. openjdk8 +lf-infra-sonatype-clm +--------------------- + +Runs a Sonatype CLM scan against a Maven project and pushes results to +Nexus IQ server. + +:Optional parameters: + :mvn-goals: The maven goals to perform for the build. + (default: clean install) + Job Templates ============= @@ -128,6 +138,8 @@ Produces a CLM scan of the code into Nexus IQ Server. :java-version: Version of Java to use for the build. (default: openjdk8) :mvn-global-settings: The name of the Maven global settings to use for Maven configuration. (default: global-settings) + :mvn-goals: The maven goals to perform for the build. + (default: clean install) :mvn-opts: Sets MAVEN_OPTS. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') :mvn-version: Version of maven to use. (default: mvn35) diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index a012691d..a01af957 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -142,6 +142,7 @@ github-url: "https://github.com" java-version: openjdk8 mvn-global-settings: global-settings + mvn-goals: clean install mvn-opts: "" mvn-params: "" mvn-version: mvn35 @@ -194,9 +195,8 @@ - lf-provide-maven-settings: global-settings-file: "{mvn-global-settings}" settings-file: "{mvn-settings}" - - shell: !include-raw-escape: - - ../shell/common-variables.sh - - ../shell/sonatype-clm.sh + - lf-infra-sonatype-clm: + mvn-goals: "{mvn-goals}" - lf-provide-maven-settings-cleanup - shell: 'find . -regex ".*karaf/target" | xargs rm -rf' - nexus-iq-policy-evaluator: @@ -206,6 +206,17 @@ scan-patterns: "{obj:nexus_iq_scan_patterns}" fail-build-network-error: true +- builder: + name: lf-infra-sonatype-clm + # Run a CLM scan build with Maven + builders: + - inject: + properties-content: | + MAVEN_GOALS={mvn-goals} + - shell: !include-raw-escape: + - ../shell/common-variables.sh + - ../shell/sonatype-clm.sh + - job-template: name: "{project-name}-maven-clm-{stream}" id: gerrit-maven-clm diff --git a/releasenotes/notes/configure-maven-clm-goals-f91df18f5b2a8d74.yaml b/releasenotes/notes/configure-maven-clm-goals-f91df18f5b2a8d74.yaml new file mode 100644 index 00000000..0f2178ba --- /dev/null +++ b/releasenotes/notes/configure-maven-clm-goals-f91df18f5b2a8d74.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Allow maven goals to be configured in sonatype-clm.sh. + Set to "clean install" by default. diff --git a/shell/sonatype-clm.sh b/shell/sonatype-clm.sh index 3642d512..20719747 100644 --- a/shell/sonatype-clm.sh +++ b/shell/sonatype-clm.sh @@ -21,7 +21,7 @@ export MAVEN_OPTS # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. # shellcheck disable=SC2086 -$MVN clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index \ +$MVN $MAVEN_GOALS dependency:tree com.sonatype.clm:clm-maven-plugin:index \ --global-settings "$GLOBAL_SETTINGS_FILE" \ --settings "$SETTINGS_FILE" \ -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \