Skip to content

Commit 7b89ace

Browse files
committed
Updated .travis.yml
The project is now following the same configuration as the https://github.com/lightblue-platform/lightblue-rest (but with a different encrypted key/pass to deploy to remote repository).
1 parent a63ab8c commit 7b89ace

File tree

8 files changed

+190
-11
lines changed

8 files changed

+190
-11
lines changed

.travis.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
language: java
22
jdk:
3-
- openjdk7
4-
- oraclejdk8
3+
- openjdk7
4+
- oraclejdk8
55
before_install:
6-
- cp ./settings.xml ~/.m2/
7-
after_success:
8-
- '[[ $TRAVIS_BRANCH == "master" ]] && [[ $TRAVIS_JDK_VERSION == "openjdk7" ]] &&
9-
{ mvn clean deploy -DskipTests; };'
10-
- mvn clean cobertura:cobertura coveralls:cobertura
6+
- cp ./etc/settings.xml ~/.m2/
7+
- cp ./etc/settings-arquillian.xml ~/
8+
- cp ./etc/onFailure.sh ~/
9+
- cp ./etc/onSuccess.sh ~/
10+
- cp ./etc/logging.properties ~/
11+
- chmod 777 ~/onFailure.sh
12+
- chmod 777 ~/onSuccess.sh
13+
script:
14+
- mvn -B clean verify cobertura:cobertura coveralls:cobertura -Dorg.apache.maven.user-settings=~/settings-arquillian.xml -Dorg.apache.maven.global-settings=~/settings-arquillian.xml
15+
after_failure: ~/onFailure.sh
16+
after_success: ~/onSuccess.sh
1117
notifications:
12-
email: false
13-
irc:
14-
channels:
15-
- chat.freenode.net#lightblue
18+
email: false
19+
irc:
20+
channels:
21+
- chat.freenode.net#lightblue
1622
on_success: always
23+
env:
24+
global:
25+
- secure: KUsWgSyKeNX8dIs/lKdxsgsXub98d1pqSqEFuEGMEvrxGoFaB63B1zoIwYI5uzv67Ir36N0H7GVgeqYsELKaU8mMcRevd/FXkALuGyUdS8/pbiXVEYtDDdWZP1VYF/p4cm3+ZzvEIhqj8ZgLWeIlXpIRYm4WAsnDzrTEG93INgk=
26+
- secure: q/2hWviyGa/Kr7zWes9f6gIW3rJ7xf7lh5tMFrtvNuhfEO4XRra+ZYG5yBHgvvLu+J/AaksmU4SBDmEY85GuLn5uh25s6OM9vwhnpJ9lz7FQ6jK6Jnm7IwMuHYIuTTXf5m702APingF73dkYijxgMnyOK9EEHE5/cWEgznOizY4=

etc/logging.properties

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Specify the handlers to create in the root logger
2+
# (all loggers are children of the root logger)
3+
# The following creates two handlers
4+
handlers= java.util.logging.ConsoleHandler
5+
6+
# Set the default logging level for new ConsoleHandler instances
7+
java.util.logging.ConsoleHandler.level= FINEST
8+
9+
# Set global verbose level
10+
.level= INFO
11+
12+
# Set log verbose level for ShrinkWrap Resolvers
13+
org.jboss.shrinkwrap.resolver.impl.maven.logging.LogTransferListener.level= FINEST
14+
org.jboss.shrinkwrap.resolver.impl.maven.logging.LogRepositoryListener.level= FINEST
15+
org.jboss.shrinkwrap.resolver.impl.maven.logging.LogModelProblemCollector.level= FINEST

etc/onFailure.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
3+
echo "DEBUG TRAVIS BUILD FAILURE"
4+
echo "Current directory is $(pwd)"
5+
echo "Sunfire reports"
6+
for i in `find . -type d -name surefire-reports` ; do for f in $i/*.txt; do echo $f : `cat $f`; done done

etc/onSuccess.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
3+
echo "DEPLOY MASTER TRAVIS BUILD"
4+
echo "Current directory is $(pwd)"
5+
'[[ $TRAVIS_BRANCH == "master" ]] && [[ $TRAVIS_JDK_VERSION == "openjdk7" ]] && { mvn clean deploy -DskipTests; };'

etc/release.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/sh
2+
3+
# https://github.com/lightblue-platform/lightblue-docs-developer/issues/6
4+
5+
RELEASE_VERSION=$1
6+
DEVEL_VERSION=$2
7+
8+
if [ $1"x" == "x" ] || [ $2"x" == "x" ]; then
9+
echo "Usage: ./release.sh <release version> <new snapshot version>"
10+
echo "Example: ./release 1.1.0 1.2.0-SNAPSHOT"
11+
exit 1
12+
fi
13+
14+
# prepare and verify state
15+
git fetch --all
16+
17+
BRANCH=`git branch | grep ^* | awk '{print $2}'`
18+
19+
if [ $BRANCH != "master" ]; then
20+
read -p "Current branch is '${BRANCH}', not 'master'. Do you wish to continue? (y/N) "
21+
if [ "$REPLY" != "y"]; then
22+
exit 1
23+
fi
24+
fi
25+
26+
# check that local branch is equal to upstream master (assumes remote of origin)
27+
MERGE_BASE=`git merge-base HEAD origin/master`
28+
HEAD_HASH=`git rev-parse HEAD`
29+
30+
if [ $MERGE_BASE != $HEAD_HASH ]; then
31+
echo "Local branch is not in sync with origin/master. Fix and run this script again."
32+
exit 1
33+
fi
34+
35+
# update to non-snapshot versions of lightblue dependencies and commit
36+
mvn versions:update-properties -DallowSnapshots=false
37+
git commit -a -m "Updated versions to non snapshot"
38+
39+
# prepare for release (note, this will warn if any snapshot dependencies still exist and allow for fixing)
40+
mvn release:prepare -P release \
41+
-DpushChanges=false \
42+
-DreleaseVersion=$RELEASE_VERSION \
43+
-DdevelopmentVersion=$DEVEL_VERSION \
44+
-Dtag=V${RELEASE_VERSION} || exit
45+
46+
# push prepared changes (doing separate just to have control)
47+
git push origin master --tags
48+
49+
# perform release
50+
mvn release:perform -P release || exit
51+
52+
mvn versions:set -DnewVersion=$DEVEL_VERSION
53+
54+
mvn clean deploy

etc/settings-arquillian.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<settings>
2+
<activeProfiles>
3+
<!--make the profile active all the time -->
4+
<activeProfile>securecentral</activeProfile>
5+
</activeProfiles>
6+
<profiles>
7+
<profile>
8+
<id>securecentral</id>
9+
<!--Override the repository (and pluginRepository) "central" from the Maven Super POM -->
10+
<repositories>
11+
<repository>
12+
<id>central</id>
13+
<url>https://repo1.maven.org/maven2</url>
14+
<releases>
15+
<enabled>true</enabled>
16+
</releases>
17+
</repository>
18+
</repositories>
19+
<pluginRepositories>
20+
<pluginRepository>
21+
<id>central</id>
22+
<url>https://repo1.maven.org/maven2</url>
23+
<releases>
24+
<enabled>true</enabled>
25+
</releases>
26+
</pluginRepository>
27+
</pluginRepositories>
28+
</profile>
29+
</profiles>
30+
</settings>

etc/settings.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<settings>
2+
<activeProfiles>
3+
<!--make the profile active all the time -->
4+
<activeProfile>securecentral</activeProfile>
5+
</activeProfiles>
6+
<profiles>
7+
<profile>
8+
<id>securecentral</id>
9+
<!--Override the repository (and pluginRepository) "central" from the Maven Super POM -->
10+
<repositories>
11+
<repository>
12+
<id>central</id>
13+
<url>https://repo1.maven.org/maven2</url>
14+
<releases>
15+
<enabled>true</enabled>
16+
</releases>
17+
</repository>
18+
</repositories>
19+
<pluginRepositories>
20+
<pluginRepository>
21+
<id>central</id>
22+
<url>https://repo1.maven.org/maven2</url>
23+
<releases>
24+
<enabled>true</enabled>
25+
</releases>
26+
</pluginRepository>
27+
</pluginRepositories>
28+
</profile>
29+
</profiles>
30+
<servers>
31+
<server>
32+
<id>sonatype-nexus-snapshots</id>
33+
<username>${env.SONATYPE_USERNAME}</username>
34+
<password>${env.SONATYPE_PASSWORD}</password>
35+
</server>
36+
<server>
37+
<id>sonatype-nexus-staging</id>
38+
<username>${env.SONATYPE_USERNAME}</username>
39+
<password>${env.SONATYPE_PASSWORD}</password>
40+
</server>
41+
</servers>
42+
</settings>

etc/sonar.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
# kill any previous port forward
4+
pkill -9 -f "rhc port-forward sonar [-]n lightblue"
5+
6+
# forward ports from openshift (assumes current server is openshift online and you're a member of the lightblue namespace)
7+
rhc port-forward sonar -n lightblue &
8+
9+
# wait a bit for port forwarding to fire up
10+
sleep 10
11+
12+
# build and publish
13+
mvn clean install -Dmaven.test.failure.ignore=true
14+
mvn -e -B sonar:sonar
15+
16+
# cleanup port forwarding
17+
pkill -9 -f "rhc port-forward sonar [-]n lightblue"

0 commit comments

Comments
 (0)