forked from testng-team/testng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis.sh
executable file
·52 lines (51 loc) · 1.69 KB
/
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -e
if [ $1 == "sonarqube" ] ; then
if [ "${TRAVIS_JDK_VERSION}" == "oraclejdk8" ] ; then
if [ -n "${TRAVIS_PULL_REQUEST}" -a "${TRAVIS_PULL_REQUEST}" != "false" ] ; then
if [ -n "${SONAR_GITHUB_OAUTH}" -a -n "${SONAR_TOKEN}" ] ; then
./gradlew sonarqube \
-Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \
-Dsonar.github.oauth=$SONAR_GITHUB_OAUTH \
-Dsonar.analysis.mode=issues \
-Dsonar.organization=org.testng:testng \
-Dsonar.organization=org.testng:testng \
-Dsonar.projectKey=org.testng:testng \
-Dsonar.login=${SONAR_TOKEN} \
--stacktrace --info
else
echo "Sonar analyse skipped: No GitHub or Sonarqube token available"
fi
else
if [ "${TRAVIS_BRANCH}" == "master" ] ; then
if [ -n "${SONAR_TOKEN}" ] ; then
./gradlew sonarqube -Dsonar.login=${SONAR_TOKEN} --stacktrace --info
else
echo "Sonar analyse skipped: No Sonarqube token available"
fi
else
echo "Sonar analyse skipped: Only on the master branch"
fi
fi
else
echo "Sonar analyse skipped: Only on Oracle JDK8"
fi
else
if [ $1 == "deploy" ] ; then
if [ "${TRAVIS_JDK_VERSION}" == "oraclejdk8" ] ; then
if [ "${TRAVIS_PULL_REQUEST}" == "false" ] ; then
if [ "${TRAVIS_BRANCH}" == "master" ] ; then
./gradlew uploadArchives --stacktrace --info
else
echo "Deploy skipped: Only the master branch"
fi
else
echo "Deploy skipped: Not on pull request"
fi
else
echo "Deploy skipped: Only on Oracle JDK7"
fi
else
echo "Skipped: $1 is not a valid param"
fi
fi