Skip to content

Commit 924c38d

Browse files
committed
[ci] Update travis ci build
1 parent fda913e commit 924c38d

File tree

2 files changed

+21
-25
lines changed

2 files changed

+21
-25
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ jdk:
55
- oraclejdk8
66
- oraclejdk7
77
- openjdk7
8-
- openjdk6
98

109
before_install:
1110
- echo "MAVEN_OPTS='-Dlicense.skip=true'" > ~/.mavenrc

travis/after_success.sh

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,45 @@
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+
34+
if [ $TRAVIS_REPO_SLUG == "mybatis/mybatis-3" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ] && [[ "$commit_message" != *"[maven-release-plugin]"* ]]; then
4335

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.
36+
if [ $TRAVIS_JDK_VERSION == "oraclejdk8" ]; then
4837

49-
if [ "$mybatis_repo" == "https://github.com/mybatis/mybatis-3.git" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ] && [[ "$commit_message" != *"[maven-release-plugin]"* ]]; then
50-
if [ $VER == "18" ]; then
51-
mvn clean deploy -Dmaven.test.skip=true -q --settings ./travis/settings.xml
38+
# Deploy to sonatype
39+
./mvnw clean deploy -Dmaven.test.skip=true -q --settings ./travis/settings.xml
5240
echo -e "Successfully deployed SNAPSHOT artifacts to Sonatype under Travis job ${TRAVIS_JOB_NUMBER}"
53-
mvn clean test jacoco:report coveralls:report -q
41+
42+
./mvnw clean test jacoco:report coveralls:report -q --settings ./travis/settings.xml
5443
echo -e "Successfully ran coveralls under Travis job ${TRAVIS_JOB_NUMBER}"
55-
# various issues exist currently in building this so comment for now
56-
# mvn site site:deploy -q
44+
45+
# Deploy to site
46+
# Cannot currently run site this way
47+
# ./mvnw site site:deploy -q --settings ./travis/settings.xml
5748
# echo -e "Successfully deploy site under Travis job ${TRAVIS_JOB_NUMBER}"
58-
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=ccf0be39fd0ca5ea5aa712247c79da7233cd3caa
49+
50+
# Deploy to sonar
51+
./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=ccf0be39fd0ca5ea5aa712247c79da7233cd3caa -q --settings ./travis/settings.xml
5952
echo -e "Successfully ran Sonar integration under Travis job ${TRAVIS_JOB_NUMBER}"
53+
else
54+
echo "Java Version does not support additonal activity for travis CI"
6055
fi
6156
else
57+
echo "Travis Pull Request: $TRAVIS_PULL_REQUEST"
58+
echo "Travis Branch: $TRAVIS_BRANCH"
6259
echo "Travis build skipped"
6360
fi

0 commit comments

Comments
 (0)