Allow java opts in WS scans 43/61743/2
authorJessica Wagantall <jwagantall@linuxfoundation.org>
Mon, 16 Sep 2019 23:47:54 +0000 (16:47 -0700)
committerJessica Wagantall <jwagantall@linuxfoundation.org>
Tue, 17 Sep 2019 16:45:33 +0000 (09:45 -0700)
Allow java options for WhiteSource
Unified Agent calls

Issue: RELENG-2387
Change-Id: I4b0d717a38448e1a8ced1ba63416c1b0a92d26e2
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
docs/jjb/lf-whitesource-jobs.rst
jjb/lf-whitesource-jobs.yaml
releasenotes/notes/whitesource-allow-java-opts-69e3da20d4ca7167.yaml [new file with mode: 0644]
shell/whitesource-unified-agent-cli.sh

index 641cfc3..9bee53f 100644 (file)
@@ -47,6 +47,7 @@ https://s3.amazonaws.com/unified-agent/wss-unified-agent.config
     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
     :build-timeout: Timeout in minutes before aborting build. (default: 60)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
+    :java-opts: Java options. Example: -Xmx1024m
     :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
index 5a10bb5..f0adbc4 100644 (file)
@@ -6,6 +6,8 @@
 - builder:
     name: lf-infra-wss-mvn-clean-install
     builders:
+      - inject:
+          properties-content: JAVA_OPTS={java-opts}
       - conditional-step:
           condition-kind: boolean-expression
           condition-expression: "{mvn-clean-install}"
@@ -90,6 +92,7 @@
     disable-job: false
     git-url: "$GIT_URL/$PROJECT"
     github-url: "https://github.com"
+    java-opts: ""
     java-version: openjdk8
     mvn-clean-install: false
     mvn-global-settings: global-settings
       - lf-update-java-alternatives:
           java-version: "{java-version}"
       - lf-infra-wss-mvn-clean-install:
+          java-opts: "{java-opts}"
           mvn-clean-install: "{mvn-clean-install}"
           mvn-version: "{mvn-version}"
           mvn-pom: "{mvn-pom}"
diff --git a/releasenotes/notes/whitesource-allow-java-opts-69e3da20d4ca7167.yaml b/releasenotes/notes/whitesource-allow-java-opts-69e3da20d4ca7167.yaml
new file mode 100644 (file)
index 0000000..da989ce
--- /dev/null
@@ -0,0 +1,5 @@
+---
+fixes:
+  - |
+    Allow java-opts to be defined in WhiteSource scans. This
+    avoids java heap failures.
index c2c8857..94dd367 100644 (file)
@@ -21,7 +21,7 @@ jar_location="/tmp/wss-unified-agent-${WSS_UNIFIED_AGENT_VERSION}.jar"
 wss_unified_agent_url="https://s3.amazonaws.com/unified-agent/wss-unified-agent-${WSS_UNIFIED_AGENT_VERSION}.jar"
 wget -nv "${wss_unified_agent_url}" -O "${jar_location}"
 echo "---> Running WhiteSource Unified Agent CLI ..."
-java -jar "${jar_location}" -c wss-unified-agent.config \
+java ${JAVA_OPTS:-} -jar "${jar_location}" -c wss-unified-agent.config \
     -product "${WSS_PRODUCT_NAME}" -project "${WSS_PROJECT_NAME}" \
     -projectVersion "${GERRIT_BRANCH}" ${WSS_UNIFIED_AGENT_OPTIONS:-}
 rm "${jar_location}"