Docs: Remove pip install method from RTD config
[releng/global-jjb.git] / shell / whitesource-unified-agent-cli.sh
index 750a152..a73e852 100644 (file)
@@ -8,7 +8,7 @@
 # which accompanies this distribution, and is available at
 # http://www.eclipse.org/legal/epl-v10.html
 ##############################################################################
-
+echo "---> whitesource-unified-agent-cli.sh"
 # This script downloads wss-unified-agent-<version>.jar and uses it to perform
 # a scan on the code whithin a repo based on the wss-unified-agent.config provided.
 
 set -xe -o pipefail
 set -u
 echo "---> whitesource-unified-agent-cli.sh"
-jar_location="/tmp/wss-unified-agent-$WSS_UNIFIED_AGENT_VERSION.jar"
-wget -nv https://s3.amazonaws.com/unified-agent/wss-unified-agent-$WSS_UNIFIED_AGENT_VERSION.jar \
-    -O $jar_location
+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 \
-    -product $WSS_PRODUCT_NAME -project $WSS_PROJECT_NAME \
-    ${WSS_UNIFIED_AGENT_OPTIONS:-}
-rm $jar_location
+
+# WSS_UNIFIED_AGENT_OPTIONS & JAVA_OPTS are expected to be unquoted
+# shellcheck disable=SC2086
+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}"