Skip to content

Commit 35a905a

Browse files
committed
[travis] Adjust travis ci builds
1 parent 75bfc83 commit 35a905a

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

travis/after_success.sh

+23-25
Original file line numberDiff line numberDiff line change
@@ -16,49 +16,47 @@
1616
#
1717

1818

19-
# Get Project Repo
20-
mybatis_repo=$(git config --get remote.origin.url 2>&1)
21-
echo "Repo detected: ${mybatis_repo}"
22-
2319
# Get Commit Message
2420
commit_message=$(git log --format=%B -n 1)
2521
echo "Current commit detected: ${commit_message}"
2622

27-
# Get the Java version.
28-
# Java 1.5 will give 15.
29-
# Java 1.6 will give 16.
30-
# Java 1.7 will give 17.
31-
# Java 1.8 will give 18.
32-
VER=`java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q'`
33-
echo "Java detected: ${VER}"
34-
3523
# We build for several JDKs on Travis.
3624
# Some actions, like analyzing the code (Coveralls) and uploading
3725
# artifacts on a Maven repository, should only be made for one version.
3826

39-
# If the version is 1.6, then perform the following actions.
27+
# If the version is 1.8, then perform the following actions.
4028
# 1. Upload artifacts to Sonatype.
4129
# 2. Use -q option to only display Maven errors and warnings.
4230
# 3. Use --settings to force the usage of our "settings.xml" file.
31+
# 4. Notify Coveralls.
32+
# 5. Deploy site
33+
# 6. Notify Sonar
34+
35+
if [ $TRAVIS_REPO_SLUG == "mybatis/spring" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ] && [[ "$commit_message" != *"[maven-release-plugin]"* ]]; then
4336

44-
# If the version is 1.7, then perform the following actions.
45-
# 1. Notify Coveralls.
46-
# 2. Deploy site
47-
# 3. Use -q option to only display Maven errors and warnings.
37+
if [ $VER == "18" ]; then
4838

49-
if [ "$mybatis_repo" == "https://github.com/mybatis/spring.git" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ] && [[ "$commit_message" != *"[maven-release-plugin]"* ]]; then
50-
if [ $VER == "16" ]; then
51-
mvn clean deploy -q --settings ./travis/settings.xml
39+
# Deploy to sonatype
40+
./mvnw clean deploy -q --settings ./travis/settings.xml
5241
echo -e "Successfully deployed SNAPSHOT artifacts to Sonatype under Travis job ${TRAVIS_JOB_NUMBER}"
53-
elif [ $VER == "18" ]; then
54-
mvn clean test jacoco:report coveralls:report -q
42+
43+
# Deploy to coveralls
44+
./mvnw clean test jacoco:report coveralls:report -q --settings ./travis/settings.xml
5545
echo -e "Successfully ran coveralls under Travis job ${TRAVIS_JOB_NUMBER}"
56-
# various issues exist currently in building this so comment for now
57-
# mvn site site:deploy -q
46+
47+
# Deploy to site
48+
# Cannot currently run site this way
49+
# ./mvnw site site:deploy -q
5850
# echo -e "Successfully deploy site under Travis job ${TRAVIS_JOB_NUMBER}"
59-
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=ccf0be39fd0ca5ea5aa712247c79da7233cd3caa
51+
52+
# Notify Sonar
53+
./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=ccf0be39fd0ca5ea5aa712247c79da7233cd3caa
6054
echo -e "Successfully ran Sonar integration under Travis job ${TRAVIS_JOB_NUMBER}"
55+
else
56+
echo "Java Version does not support additonal activity for travis CI"
6157
fi
6258
else
59+
echo "Travis Pull Request: $TRAVIS_PULL_REQUEST"
60+
echo "Travis Branch: $TRAVIS_BRANCH"
6361
echo "Travis build skipped"
6462
fi

0 commit comments

Comments
 (0)