-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
64 lines (59 loc) · 2.12 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
language: java
cache:
directories:
- $HOME/.m2
jdk:
- openjdk8
stages:
- test
- name: deploy-snapshots
if: branch = master AND type = push
- name: release-check
if: (branch =~ /^release.*/)
- name: release
if: (branch =~ /^release.*/)
before_install:
# Ensure the settings we want to use are in place before running the default mvn install
- cp ./travis/maven-settings.xml $HOME/.m2/settings.xml
- sed -i "s/-SNAPSHOT/-build-$TRAVIS_BUILD_NUMBER/" pom.xml
# Disable SourceClear except on scheduled builds
- |
if [ "$TRAVIS_EVENT_TYPE" != "cron" ]
then
export NOSCAN=1
fi
jobs:
include:
- stage: test
addons:
srcclr: true
# Skip the default mvn command because we want to set the profile explicitly
install: true
script:
- echo "test"
- mvn -e verify
after_failure:
- echo "\n=== SUREFIRE REPORTS ===\n"
- for F in target/surefire-reports/*.txt; do echo $F; cat $F; echo; done
- stage: deploy-snapshots
script:
- echo "deploy-snapshots"
# When push to master occurs, all the versions should be -SNAPSHOTs and we will auto-deploy
- mvn --batch-mode -e -DskipTests=true deploy
- stage: release-check
script:
- echo "release-check"
# Ensure we don't have any external SNAPSHOT dependencies
- mvn --batch-mode release:prepare -DskipTests=true -DdryRun=true
- stage: release
script:
- echo "release"
# Git fix based on: https://github.com/sbt/sbt-release/issues/210
- echo "Fixing git setup for $TRAVIS_BRANCH in preparation for release"
- git checkout ${TRAVIS_BRANCH}
- git branch -u origin/${TRAVIS_BRANCH}
- git config branch.${TRAVIS_BRANCH}.remote origin
- git config branch.${TRAVIS_BRANCH}.merge refs/heads/${TRAVIS_BRANCH}
# Perform mvn release steps
- mvn --batch-mode release:prepare -DskipTests=true -DscmCommentPrefix="[maven-release-plugin][skip travis]" # NOTE: this stop's travis from building based on the tag's commit/push.
- mvn --batch-mode release:perform