File tree Expand file tree Collapse file tree 4 files changed +48
-4
lines changed Expand file tree Collapse file tree 4 files changed +48
-4
lines changed Original file line number Diff line number Diff line change 1
1
* .phar
2
2
.idea
3
- * .sh
4
3
* ~
5
4
ci
6
5
composer.lock
@@ -23,3 +22,6 @@ test.php
23
22
24
23
# phpenv
25
24
.php-version
25
+
26
+ # Sonarqube
27
+ .scannerwork
Original file line number Diff line number Diff line change 1
1
language : php
2
2
3
+ git :
4
+ depth : false
5
+
3
6
env :
4
7
global :
5
8
- COMPOSER_DISABLE_XDEBUG_WARN=1
6
9
7
10
matrix :
8
11
include :
9
12
- dist : precise
10
- php : ' 5.3 '
13
+ php : ' 5.4 '
11
14
- dist : xenial
12
15
php : ' 7.2'
16
+ after_success :
17
+ - bash sonar-scanner.sh
13
18
14
19
services :
15
20
- redis-server
Original file line number Diff line number Diff line change 27
27
"require-dev" : {
28
28
"phpunit/phpunit" : " ~4.0" ,
29
29
"phpdocumentor/phpdocumentor" : " 2.*" ,
30
- "squizlabs/php_codesniffer" : " 2.*"
30
+ "squizlabs/php_codesniffer" : " 2.*" ,
31
+ "rogervila/php-sonarqube-scanner" : " 0.4.0"
31
32
},
32
-
33
+
33
34
"autoload" : {
34
35
"psr-4" : {
35
36
"SplitIO\\ " : " src/SplitIO/" ,
Original file line number Diff line number Diff line change
1
+ # /bin/bash -e
2
+
3
+ sonar_scanner () {
4
+ local params=" $@ "
5
+
6
+ vendor/bin/sonar-scanner \
7
+ -Dsonar.host.url=' https://sonarqube.split-internal.com' \
8
+ -Dsonar.login=" $SONAR_TOKEN " \
9
+ -Dsonar.ws.timeout=' 300' \
10
+ -Dsonar.sources=' ./src' \
11
+ -Dsonar.projectName=' php-client' \
12
+ -Dsonar.exclusions=' **/tests/**/*.*' \
13
+ -Dsonar.links.ci=' https://travis-ci.com/splitio/php-client' \
14
+ -Dsonar.links.scm=' https://github.com/splitio/php-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/php-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 " == ' develop' ]; then
29
+ TARGET_BRANCH=' master'
30
+ else
31
+ TARGET_BRANCH=' develop'
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