From 302e79ca8281c0acbdab9f385f65bdfc1fea08e8 Mon Sep 17 00:00:00 2001 From: Jessica Wagantall Date: Wed, 10 Apr 2019 22:14:13 -0700 Subject: [PATCH] Add lf-infra-wss-mvn-clean-install step Add Maven clean install conditional step that runs before WhiteSource Unified Agent scan. This allows to fetch additional dependencies. Issue: RELENG-1951 Change-Id: Id3e070220e17ba995d976b3d033a16983b38fd8d Signed-off-by: Jessica Wagantall --- .jjb-test/lf-whitesource-jobs.yaml | 3 ++- docs/jjb/lf-whitesource-jobs.rst | 10 +++++++++ jjb/lf-whitesource-jobs.yaml | 25 ++++++++++++++++++++++ ...fra-wss-mvn-clean-install-b656639f6d19575e.yaml | 6 ++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/lf-infra-wss-mvn-clean-install-b656639f6d19575e.yaml diff --git a/.jjb-test/lf-whitesource-jobs.yaml b/.jjb-test/lf-whitesource-jobs.yaml index 16186665..d74adf7a 100644 --- a/.jjb-test/lf-whitesource-jobs.yaml +++ b/.jjb-test/lf-whitesource-jobs.yaml @@ -4,7 +4,8 @@ jobs: - gerrit-whitesource-scan branch: 'master' + mvn-clean-install: true + mvn-settings: 'whitesource-scan-project-settings' project: 'whitesource/scan-project-jobs' project-name: 'whitesource-scan-project' wss-product-name: EXAMPLE-ORG - wss-unified-agent-config: '.config/wss-unified-agent.config' diff --git a/docs/jjb/lf-whitesource-jobs.rst b/docs/jjb/lf-whitesource-jobs.rst index 5750a0f4..dd8fda30 100644 --- a/docs/jjb/lf-whitesource-jobs.rst +++ b/docs/jjb/lf-whitesource-jobs.rst @@ -5,6 +5,11 @@ WhiteSource Jobs Macros ====== +lf-infra-wss-mvn-clean-install +------------------------------ + +Run maven clean install. Applicable to Maven based repos. + lf-infra-wss-unified-agent-scan ------------------------------- @@ -43,6 +48,11 @@ https://s3.amazonaws.com/unified-agent/wss-unified-agent.config :build-timeout: Timeout in minutes before aborting build. (default: 60) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :java-version: Version of Java to use for the build. (default: openjdk8) + :mvn-clean-install: Run maven clean install before the code scan. (default: false) + :mvn-global-settings: The name of the Maven global settings to use for + Maven configuration. (default: global-settings) + :mvn-version: Version of maven to use. (default: mvn35) + :pom: Path of the pom.xml file. :stream: Keyword used to represent a release code-name. Often the same as the branch. (default: master) :submodule-recursive: Whether to checkout submodules recursively. diff --git a/jjb/lf-whitesource-jobs.yaml b/jjb/lf-whitesource-jobs.yaml index 7dc5d507..b7c3672e 100644 --- a/jjb/lf-whitesource-jobs.yaml +++ b/jjb/lf-whitesource-jobs.yaml @@ -4,6 +4,22 @@ # Macros # ########## +- builder: + name: lf-infra-wss-mvn-clean-install + builders: + - conditional-step: + condition-kind: boolean-expression + condition-expression: '{mvn-clean-install}' + steps: + - maven-target: + maven-version: '{mvn-version}' + pom: '{mvn-pom}' + goals: 'clean install' + settings: '{mvn-settings}' + settings-type: cfp + global-settings: 'global-settings' + global-settings-type: cfp + - builder: name: lf-infra-wss-unified-agent-scan builders: @@ -76,6 +92,10 @@ git-url: '$GIT_URL/$PROJECT' github-url: 'https://github.com' java-version: openjdk8 + mvn-clean-install: false + mvn-global-settings: global-settings + mvn-pom: '' + mvn-version: mvn35 stream: master submodule-recursive: true submodule-timeout: 10 @@ -122,6 +142,11 @@ - lf-infra-pre-build - lf-update-java-alternatives: java-version: '{java-version}' + - lf-infra-wss-mvn-clean-install: + mvn-clean-install: '{mvn-clean-install}' + mvn-version: '{mvn-version}' + mvn-pom: '{mvn-pom}' + mvn-settings: '{mvn-settings}' - lf-infra-wss-unified-agent-scan - job-template: diff --git a/releasenotes/notes/lf-infra-wss-mvn-clean-install-b656639f6d19575e.yaml b/releasenotes/notes/lf-infra-wss-mvn-clean-install-b656639f6d19575e.yaml new file mode 100644 index 00000000..77f4a76c --- /dev/null +++ b/releasenotes/notes/lf-infra-wss-mvn-clean-install-b656639f6d19575e.yaml @@ -0,0 +1,6 @@ +--- +features: + - Allows maven to run a clean install step before + the WhiteSource scan runs the Unified Agent to + fetch additional dependencies. Set to false by + default. -- 2.16.6