-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscan
More file actions
executable file
·26 lines (22 loc) · 948 Bytes
/
Copy pathscan
File metadata and controls
executable file
·26 lines (22 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
set -eu
echo "Generate coverage and test report"
python3 setup.py develop && pytest --cov=pacemaker --cov-report=xml --junitxml=pytest-report.xml
echo "Fetching version from setup.py"
ver=$(python setup.py --version)
echo "Scanning now..."
# SONAR_CLOUD_TOKEN should be added in circleci
if [ 'master' = $CIRCLE_BRANCH ]
then
sonar-scanner -X -Dsonar.login="$SONAR_CLOUD_TOKEN" \
-Dsonar.projectVersion="$ver"
else
PR_KEY=$(echo "$CIRCLE_PULL_REQUEST" | cut -f7 -d "/")
sonar-scanner -X -Dsonar.login="$SONAR_CLOUD_TOKEN" \
-Dsonar.pullrequest.branch="$CIRCLE_BRANCH" \
-Dsonar.pullrequest.key="$PR_KEY" \
-Dsonar.pullrequest.base=master \
-Dsonar.pullrequest.provider=GitHub \
-Dsonar.pullrequest.github.repository=mkeshav/pace-maker \
-Dsonar.projectVersion="$ver"
fi