Skip to content

Commit d53eb8a

Browse files
committed
ci: use pysonar scanner a python library to scan the repo
Signed-off-by: Arjun Rajappa <[email protected]>
1 parent aa9f6bb commit d53eb8a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.circleci/config.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,26 +96,25 @@ commands:
9696
python -m venv venv
9797
. venv/bin/activate
9898
pip install --upgrade pip coverage
99+
coverage combine ./coverage_results
100+
coverage xml -i
99101
100102
PR_NUMBER=$(echo ${CIRCLE_PULL_REQUEST} | sed 's/.*\///')
101-
SONAR_SCANNER_VERSION=7.2.0.5079
102-
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64
103103
SONAR_TOKEN=${SONAR_TOKEN}
104104
105-
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip
106-
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
107-
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
105+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pysonar-scanner
108106
export SONAR_SCANNER_OPTS="-server"
107+
109108
if [[ -n "${PR_NUMBER}" ]]; then
110-
sonar-scanner \
109+
pysonar-scanner \
111110
-Dsonar.organization=instana \
112111
-Dsonar.projectKey=instana_python-sensor \
113112
-Dsonar.sources=. \
114113
-Dsonar.host.url="${SONARQUBE_URL}" \
115114
-Dsonar.pullrequest.key="${PR_NUMBER}" \
116115
-Dsonar.pullrequest.branch="${CIRCLE_BRANCH}"
117116
else
118-
sonar-scanner \
117+
pysonar-scanner \
119118
-Dsonar.organization=instana \
120119
-Dsonar.projectKey=instana_python-sensor \
121120
-Dsonar.sources=. \

0 commit comments

Comments
 (0)