X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fnexus-iq-python-cli.sh;h=037d18915faf13b8cdcbd1bdbc6b3c9596e4d9b2;hb=refs%2Ftags%2Fv0.89.4;hp=929cf8edbab05e0eade3f85b8c45b6fee5ed375e;hpb=4082e0a566179aa25ea50e870d077e2b8318995e;p=releng%2Fglobal-jjb.git diff --git a/shell/nexus-iq-python-cli.sh b/shell/nexus-iq-python-cli.sh index 929cf8ed..037d1891 100644 --- a/shell/nexus-iq-python-cli.sh +++ b/shell/nexus-iq-python-cli.sh @@ -17,16 +17,29 @@ echo "---> nexus-iq-python-cli.sh" set -eu # do not print commands, credentials should not be logged set +x + +# shellcheck disable=SC1090 +. ~/lf-env.sh + +lf-activate-venv --python python3 --venv-file /tmp/.nexusiq virtualenv + CLI_LOCATION="/tmp/nexus-iq-cli-${NEXUS_IQ_CLI_VERSION}.jar" echo "INFO: downloading nexus-iq-cli version $NEXUS_IQ_CLI_VERSION" wget -nv "https://download.sonatype.com/clm/scanner/nexus-iq-cli-${NEXUS_IQ_CLI_VERSION}.jar" -O "${CLI_LOCATION}" echo "-a" > cli-auth.txt echo "${NEXUS_IQ_USER}:${NEXUS_IQ_PASSWORD}" >> cli-auth.txt -echo "INFO: running nexus-iq-cli on project $NEXUS_IQ_PROJECT_NAME and file $REQUIREMENTS_FILE" +if [ -z "${NEXUS_TARGET_BUILD}" ]; then + echo "WARN: NEXUS_TARGET_BUILD has not been set" +fi +echo "INFO: running nexus-iq-cli on project $NEXUS_IQ_PROJECT_NAME and target: ${NEXUS_TARGET_BUILD}" +echo "Downloading Python dependencies into target directory" +python3 -m pip download -r requirements.txt -d "${NEXUS_TARGET_BUILD}" # result.json is a mystery +# Do NOT double-quote ${NEXUS_TARGET_BUILD} below; causes breakage +# shellcheck disable=SC2086 java -jar "${CLI_LOCATION}" @cli-auth.txt \ -s https://nexus-iq.wl.linuxfoundation.org -i "${NEXUS_IQ_PROJECT_NAME}" \ - -t build -r result.json "${NEXUS_TARGET_BUILD}" + -t build -r result.json ${NEXUS_TARGET_BUILD} rm cli-auth.txt rm "${CLI_LOCATION}"