Skip to content

Commit 29226e5

Browse files
committed
Don't specify target branch when branch is master
1 parent 8bb88f6 commit 29226e5

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
@@ -8,12 +8,17 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
88
-Dsonar.pullrequest.branch=$TRAVIS_PULL_REQUEST_BRANCH \
99
-Dsonar.pullrequest.base=$TRAVIS_BRANCH
1010
else
11-
if [ "$TRAVIS_BRANCH" == 'development' ]; then
12-
TARGET_BRANCH='master'
11+
if [ "$TRAVIS_BRANCH" == 'master' ]; then
12+
mvn --batch-mode sonar:sonar -DskipTests \
13+
-Dsonar.branch.name=$TRAVIS_BRANCH
1314
else
14-
TARGET_BRANCH='development'
15-
fi
15+
if [ "$TRAVIS_BRANCH" == 'development' ]; then
16+
TARGET_BRANCH='master'
17+
else
18+
TARGET_BRANCH='development'
19+
fi
1620
mvn --batch-mode sonar:sonar -DskipTests \
17-
-Dsonar.branch.name=$TRAVIS_BRANCH \
18-
-Dsonar.branch.target=$TARGET_BRANCH
21+
-Dsonar.branch.name=$TRAVIS_BRANCH \
22+
-Dsonar.branch.target=$TARGET_BRANCH
23+
fi
1924
fi

0 commit comments

Comments
 (0)