Use yq instead of niet
[releng/global-jjb.git] / shell / nexus-iq-cli.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> nexus-iq-cli.sh"
12 # This script downloads the specified version of the nexus-iq-cli jar, uses it
13 # to perform an XC Evaluation or extended report which provides a scan of python
14 # files within the repo starting at the root, then publishes the result to an LF
15 # server using the specified credentials.
16
17 # stop on error or unbound variable
18 set -eu
19 # do not print commands, credentials should not be logged
20 set +x
21 CLI_LOCATION="/tmp/nexus-iq-cli-${NEXUS_IQ_CLI_VERSION}.jar"
22 echo "INFO: downloading nexus-iq-cli version $NEXUS_IQ_CLI_VERSION"
23 wget -nv "https://download.sonatype.com/clm/scanner/nexus-iq-cli-${NEXUS_IQ_CLI_VERSION}.jar" -O "${CLI_LOCATION}"
24 echo "-a" > cli-auth.txt
25 echo "${CLM_USER}:${CLM_PASSWORD}" >> cli-auth.txt
26 echo "INFO: running nexus-iq-cli scan on project $CLM_PROJECT_NAME"
27 java -jar "${CLI_LOCATION}" @cli-auth.txt -xc -i "${CLM_PROJECT_NAME}" -s https://nexus-iq.wl.linuxfoundation.org -t build .
28 rm cli-auth.txt
29 rm "${CLI_LOCATION}"
30
31 echo "---> nexus-iq-cli.sh ends"