1
+ #! /bin/bash
2
+ #
3
+ # Copyright 2018 the original author or authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+
19
+ # Get Commit Message
20
+ commit_message=$( git log --format=%B -n 1)
21
+ echo " Current commit detected: ${commit_message} "
22
+
23
+ # We build for several JDKs on Travis.
24
+ # Some actions, like analyzing the code (Coveralls) and uploading
25
+ # artifacts on a Maven repository, should only be made for one version.
26
+
27
+ # If the version is 1.8, then perform the following actions.
28
+ # 1. Upload artifacts to Sonatype.
29
+ # 2. Use -q option to only display Maven errors and warnings.
30
+ # 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/thymeleaf-scripting" ] && [ " $TRAVIS_PULL_REQUEST " == " false" ] && [ " $TRAVIS_BRANCH " == " master" ] && [[ " $commit_message " != * " [maven-release-plugin]" * ]]; then
35
+
36
+ if [ $TRAVIS_JDK_VERSION == " oraclejdk8" ]; then
37
+
38
+ # Deploy to sonatype
39
+ ./mvnw clean deploy -q --settings ./travis/settings.xml
40
+ echo -e " Successfully deployed SNAPSHOT artifacts to Sonatype under Travis job ${TRAVIS_JOB_NUMBER} "
41
+
42
+ # Deploy to coveralls
43
+ ./mvnw clean test jacoco:report coveralls:report -q --settings ./travis/settings.xml
44
+ echo -e " Successfully ran coveralls under Travis job ${TRAVIS_JOB_NUMBER} "
45
+
46
+ # Deploy to site
47
+ # Cannot currently run site this way
48
+ # ./mvnw site site:deploy -q --settings ./travis/settings.xml
49
+ # echo -e "Successfully deploy site under Travis job ${TRAVIS_JOB_NUMBER}"
50
+ else
51
+ echo " Java Version does not support additional activity for travis CI"
52
+ fi
53
+ else
54
+ echo " Travis Pull Request: $TRAVIS_PULL_REQUEST "
55
+ echo " Travis Branch: $TRAVIS_BRANCH "
56
+ echo " Travis build skipped"
57
+ fi
0 commit comments