forked from ajoberstar/gradle-git-publish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis.sh
executable file
·23 lines (21 loc) · 858 Bytes
/
travis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -euo pipefail
export TERM=dumb
if [ "${TRAVIS_BRANCH}" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo 'Running Gradle check with SonarQube analysis'
./gradlew clean check sonarqube \
-Dsonar.host.url=https://sonarqube.ajoberstar.com \
-Dsonar.login=$SONARQUBE_TOKEN
elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN:-}" ]; then
echo 'Running Gradle check with SonarQube preview for pull requests'
./gradlew clean check sonarqube \
-Dsonar.host.url=https://sonarqube.ajoberstar.com \
-Dsonar.login=$SONARQUBE_TOKEN \
-Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \
-Dsonar.github.repository=$TRAVIS_REPO_SLUG \
-Dsonar.github.oauth=$GITHUB_TOKEN \
-Dsonar.analysis.mode=preview
else
echo 'Running Gradle check without SonarQube analysis'
./gradlew clean check
fi