From: Jessica Wagantall Date: Mon, 16 Sep 2019 23:47:54 +0000 (-0700) Subject: Allow java opts in WS scans X-Git-Tag: v0.44.0~6^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F61743%2F2;p=releng%2Fglobal-jjb.git Allow java opts in WS scans Allow java options for WhiteSource Unified Agent calls Issue: RELENG-2387 Change-Id: I4b0d717a38448e1a8ced1ba63416c1b0a92d26e2 Signed-off-by: Jessica Wagantall --- diff --git a/docs/jjb/lf-whitesource-jobs.rst b/docs/jjb/lf-whitesource-jobs.rst index 641cfc3f..9bee53f0 100644 --- a/docs/jjb/lf-whitesource-jobs.rst +++ b/docs/jjb/lf-whitesource-jobs.rst @@ -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 diff --git a/jjb/lf-whitesource-jobs.yaml b/jjb/lf-whitesource-jobs.yaml index 5a10bb57..f0adbc4d 100644 --- a/jjb/lf-whitesource-jobs.yaml +++ b/jjb/lf-whitesource-jobs.yaml @@ -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 @@ -143,6 +146,7 @@ - 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 index 00000000..da989ced --- /dev/null +++ b/releasenotes/notes/whitesource-allow-java-opts-69e3da20d4ca7167.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Allow java-opts to be defined in WhiteSource scans. This + avoids java heap failures. diff --git a/shell/whitesource-unified-agent-cli.sh b/shell/whitesource-unified-agent-cli.sh index c2c8857d..94dd3670 100644 --- a/shell/whitesource-unified-agent-cli.sh +++ b/shell/whitesource-unified-agent-cli.sh @@ -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}"