Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: Debug Sonarqube runs #1766

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions sonarqube.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash

mkdir $PWD/sonarqube/
mkdir $PWD/sonarqube/download/
mkdir $PWD/sonarqube/extract/
mkdir $PWD/sonarqube/certs/
mkdir $PWD/sonarqube/store/
set -x

mkdir -p $PWD/sonarqube/
mkdir -p $PWD/sonarqube/download/
mkdir -p $PWD/sonarqube/extract/
mkdir -p $PWD/sonarqube/certs/
mkdir -p $PWD/sonarqube/store/

curl -o $PWD/sonarqube/certs/RH-IT-Root-CA.crt --insecure $ROOT_CA_CERT_URL

Expand All @@ -25,26 +27,27 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
fi

export SONAR_SCANNER_CLI_VERSION="4.7.0.2747"
export SONAR_SCANNER_DOWNLOAD_NAME="sonar-scanner-cli-$SONAR_SCANNER_CLI_VERSION-$SONAR_SCANNER_OS"
export SONAR_SCANNER_NAME="sonar-scanner-$SONAR_SCANNER_CLI_VERSION-$SONAR_SCANNER_OS"
export SONAR_SCANNER_DOWNLOAD_NAME="sonar-scanner-cli-${SONAR_SCANNER_CLI_VERSION}-${SONAR_SCANNER_OS}"
export SONAR_SCANNER_NAME="sonar-scanner-${SONAR_SCANNER_CLI_VERSION}-${SONAR_SCANNER_OS}"

curl -o $PWD/sonarqube/download/$SONAR_SCANNER_DOWNLOAD_NAME.zip --insecure $SONARQUBE_CLI_URL

unzip -d $PWD/sonarqube/extract/ $PWD/sonarqube/download/$SONAR_SCANNER_DOWNLOAD_NAME.zip

export PATH="$PWD/sonarqube/extract/$SONAR_SCANNER_NAME/bin:$PATH"

COMMIT_SHORT=$(git rev-parse --short=7 HEAD)

ls -l $PWD/sonarqube/extract/$SONAR_SCANNER_NAME/bin/

sonar-scanner \
-Dsonar.projectKey=console.redhat.com:insights-host-inventory \
-Dsonar.sources=$PWD \
-Dsonar.host.url=$SONARQUBE_REPORT_URL \
-Dsonar.projectVersion=$COMMIT_SHORT \
-Dsonar.login=$SONARQUBE_TOKEN
-Dsonar.sources="$PWD" \
-Dsonar.host.url="$SONARQUBE_REPORT_URL" \
-Dsonar.projectVersion="$COMMIT_SHORT" \
-Dsonar.login="$SONARQUBE_TOKEN"

mkdir -p $WORKSPACE/artifacts
cat << EOF > ${WORKSPACE}/artifacts/junit-dummy.xml
mkdir -p "$WORKSPACE"/artifacts
cat << EOF > "${WORKSPACE}"/artifacts/junit-dummy.xml
<testsuite tests="1">
<testcase classname="dummy" name="dummytest"/>
</testsuite>
Expand Down