Add lf-infra-wss-mvn-clean-install step 61/15261/3
authorJessica Wagantall <jwagantall@linuxfoundation.org>
Thu, 11 Apr 2019 05:14:13 +0000 (22:14 -0700)
committerJessica Wagantall <jwagantall@linuxfoundation.org>
Thu, 11 Apr 2019 05:26:56 +0000 (22:26 -0700)
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 <jwagantall@linuxfoundation.org>
.jjb-test/lf-whitesource-jobs.yaml
docs/jjb/lf-whitesource-jobs.rst
jjb/lf-whitesource-jobs.yaml
releasenotes/notes/lf-infra-wss-mvn-clean-install-b656639f6d19575e.yaml [new file with mode: 0644]

index 1618666..d74adf7 100644 (file)
@@ -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'
index 5750a0f..dd8fda3 100644 (file)
@@ -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.
index 7dc5d50..b7c3672 100644 (file)
@@ -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:
     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
       - 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 (file)
index 0000000..77f4a76
--- /dev/null
@@ -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.