File tree Expand file tree Collapse file tree 2 files changed +48
-3
lines changed
Expand file tree Collapse file tree 2 files changed +48
-3
lines changed Original file line number Diff line number Diff line change 11language : python
22
3- python :
4- - " 2.7"
5- - " 3.6"
3+ git :
4+ depth : false
5+
6+ matrix :
7+ include :
8+ - python : ' 2.7'
9+ - python : ' 3.6'
10+ after_success :
11+ - bash sonar-scanner.sh
612
713services :
814 - redis-server
915
16+ addons :
17+ sonarqube : true
18+
1019install :
1120 - pip install -U setuptools pip
1221 - pip install -e .[cpphash,redis,uwsgi]
Original file line number Diff line number Diff line change 1+ # /bin/bash -e
2+
3+ sonar_scanner () {
4+ local params=$@
5+
6+ sonar-scanner \
7+ -Dsonar.host.url=' https://sonarqube.split-internal.com' \
8+ -Dsonar.login=" $SONAR_TOKEN " \
9+ -Dsonar.ws.timeout=' 300' \
10+ -Dsonar.sources=' splitio' \
11+ -Dsonar.projectName=' python-client' \
12+ -Dsonar.projectKey=' python-client' \
13+ -Dsonar.links.ci=' https://travis-ci.com/splitio/python-client' \
14+ -Dsonar.links.scm=' https://github.com/splitio/python-client' \
15+ ${params}
16+
17+ return $?
18+ }
19+
20+ if [ " $TRAVIS_PULL_REQUEST " != " false" ]; then
21+ sonar_scanner \
22+ -Dsonar.pullrequest.provider=' GitHub' \
23+ -Dsonar.pullrequest.github.repository=' splitio/python-client' \
24+ -Dsonar.pullrequest.key=$TRAVIS_PULL_REQUEST \
25+ -Dsonar.pullrequest.branch=$TRAVIS_PULL_REQUEST_BRANCH \
26+ -Dsonar.pullrequest.base=$TRAVIS_BRANCH
27+ else
28+ if [ " $TRAVIS_BRANCH " == ' development' ]; then
29+ TARGET_BRANCH=' master'
30+ else
31+ TARGET_BRANCH=' development'
32+ fi
33+ sonar_scanner \
34+ -Dsonar.branch.name=$TRAVIS_BRANCH \
35+ -Dsonar.branch.target=$TARGET_BRANCH
36+ fi
You can’t perform that action at this time.
0 commit comments