Skip to content

Commit 2b50267

Browse files
authored
Merge pull request #139 from splitio/fix/sonar-scanner
Don't specify target branch when branch is master
2 parents 386024f + a4e2e61 commit 2b50267

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

sonar-scanner.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,17 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
2525
-Dsonar.pullrequest.branch=$TRAVIS_PULL_REQUEST_BRANCH \
2626
-Dsonar.pullrequest.base=$TRAVIS_BRANCH
2727
else
28-
if [ "$TRAVIS_BRANCH" == 'develop' ]; then
29-
TARGET_BRANCH='master'
28+
if [ "$TRAVIS_BRANCH" == 'master' ]; then
29+
sonar_scanner \
30+
-Dsonar.branch.name=$TRAVIS_BRANCH
3031
else
31-
TARGET_BRANCH='develop'
32+
if [ "$TRAVIS_BRANCH" == 'develop' ]; then
33+
TARGET_BRANCH='master'
34+
else
35+
TARGET_BRANCH='develop'
36+
fi
37+
sonar_scanner \
38+
-Dsonar.branch.name=$TRAVIS_BRANCH \
39+
-Dsonar.branch.target=$TARGET_BRANCH
3240
fi
33-
sonar_scanner \
34-
-Dsonar.branch.name=$TRAVIS_BRANCH \
35-
-Dsonar.branch.target=$TARGET_BRANCH
3641
fi

0 commit comments

Comments
 (0)