Skip to content

Commit c293f25

Browse files
committed
Merge pull request #28 from hazendaz/master
Reworking builds
2 parents deeb488 + 2ee5ecb commit c293f25

File tree

5 files changed

+69
-9
lines changed

5 files changed

+69
-9
lines changed

.travis.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
language: java
2+
sudo: false
3+
24
jdk:
35
- oraclejdk8
46
- oraclejdk7
57
- openjdk7
68
- openjdk6
7-
after_success:
8-
- "git clone -b travis `git config --get remote.origin.url` target/travis"
9-
- "mvn deploy --settings target/travis/settings.xml"
109

11-
branches:
12-
except:
13-
- travis
10+
after_success:
11+
- chmod -R 777 ./travis/after_success.sh
12+
- ./travis/after_success.sh
1413

1514
env:
1615
global:

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ MyBatis Velocity Support
22
========================
33

44
[![Build Status](https://travis-ci.org/mybatis/velocity-scripting.svg?branch=master)](https://travis-ci.org/mybatis/velocity-scripting)
5-
[![Dependency Status](https://www.versioneye.com/user/projects/560f3b3b5a262f001a000a20/badge.svg?style=flat)](https://www.versioneye.com/user/projects/560f3b3b5a262f001a000a20)
5+
[![Coverage Status](https://coveralls.io/repos/mybatis/velocity-scripting/badge.svg?branch=master&service=github)](https://coveralls.io/github/mybatis/velocity-scripting?branch=master)
6+
[![Dependency Status](https://www.versioneye.com/user/projects/5619b768a193340f32000648/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5619b768a193340f32000648)
67
[![Maven central](https://maven-badges.herokuapp.com/maven-central/org.mybatis.scripting/mybatis-velocity/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.mybatis.scripting/mybatis-velocity)
8+
[![Apache 2](http://img.shields.io/badge/license-Apache%202-red.svg)](http://www.apache.org/licenses/LICENSE-2.0)
79

810
![mybatis-velocity](http://mybatis.github.io/images/mybatis-logo.png)
911

pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
<parent>
2121
<groupId>org.mybatis</groupId>
2222
<artifactId>mybatis-parent</artifactId>
23-
<version>25</version>
23+
<version>26-SNAPSHOT</version>
24+
<relativePath />
2425
</parent>
2526

2627
<groupId>org.mybatis.scripting</groupId>
@@ -80,7 +81,7 @@
8081
<dependency>
8182
<groupId>org.hsqldb</groupId>
8283
<artifactId>hsqldb</artifactId>
83-
<version>2.3.2</version>
84+
<version>2.3.3</version>
8485
<scope>test</scope>
8586
</dependency>
8687
<dependency>

travis/after_success.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
# Get Project Repo
4+
mybatis_repo=$(git config --get remote.origin.url 2>&1)
5+
echo "Repo detected: ${mybatis_repo}"
6+
7+
# Get the Java version.
8+
# Java 1.5 will give 15.
9+
# Java 1.6 will give 16.
10+
# Java 1.7 will give 17.
11+
# Java 1.8 will give 18.
12+
VER=`java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q'`
13+
echo "Java detected: ${VER}"
14+
15+
# We build for several JDKs on Travis.
16+
# Some actions, like analyzing the code (Coveralls) and uploading
17+
# artifacts on a Maven repository, should only be made for one version.
18+
19+
# If the version is 1.6, then perform the following actions.
20+
# 1. Upload artifacts to Sonatype.
21+
# 2. Use -q option to only display Maven errors and warnings.
22+
# 3. Use --settings to force the usage of our "settings.xml" file.
23+
24+
# If the version is 1.7, then perform the following actions.
25+
# 1. Notify Coveralls.
26+
# 2. Deploy site
27+
# 3. Use -q option to only display Maven errors and warnings.
28+
29+
if [ "$mybatis_repo" == "https://github.com/mybatis/velocity-scripting.git" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
30+
if [ $VER == "16" ]; then
31+
mvn clean deploy -q --settings ./travis/settings.xml
32+
echo -e "Successfully deployed SNAPSHOT artifacts to Sonatype under Travis job ${TRAVIS_JOB_NUMBER}"
33+
elif [ $VER == "17" ]; then
34+
mvn clean test jacoco:report coveralls:report -q
35+
echo -e "Successfully ran coveralls under Travis job ${TRAVIS_JOB_NUMBER}"
36+
# various issues exist currently in building this so comment for now
37+
# mvn site site:deploy -q
38+
# echo -e "Successfully deploy site under Travis job ${TRAVIS_JOB_NUMBER}"
39+
fi
40+
else
41+
echo "Travis build skipped"
42+
fi

travis/settings.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
4+
<servers>
5+
<server>
6+
<id>ossrh</id>
7+
<username>${env.CI_DEPLOY_USERNAME}</username>
8+
<password>${env.CI_DEPLOY_PASSWORD}</password>
9+
</server>
10+
<server>
11+
<id>gh-pages</id>
12+
<username>git</username>
13+
<password>${env.CI_SITE_PASSWORD}</password>
14+
</server>
15+
</servers>
16+
</settings>

0 commit comments

Comments
 (0)