-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
66 lines (60 loc) · 2.94 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
65
66
language: java
jdk:
- openjdk17
dist: trusty
cache:
directories:
- $HOME/.m2
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
- sed -i "s/-SNAPSHOT/-build-$TRAVIS_BUILD_NUMBER/" vertx-parent-files/pom.xml
jobs:
include:
- stage: test
# Skip the default mvn command because we want to set the profile explicitly
install: true
script:
- echo "test"
- mvn -Dmaven.wagon.http.retryHandler.count=3 -e test
- mvn --batch-mode install -DskipTests=true -Dmaven.javadoc.skip=true -Dcheck1
- mvn --batch-mode install -DskipTests=true -Dmaven.javadoc.skip=true -Dcheck2
- mvn -Dmaven.wagon.http.retryHandler.count=3 -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 -Dmaven.wagon.http.retryHandler.count=3 --batch-mode -e -DskipTests=true deploy
- stage: release-check
script:
- echo "release-check"
# Ensure we don't have any external SNAPSHOT dependencies
- mvn -Dmaven.wagon.http.retryHandler.count=3 --batch-mode release:prepare -DskipTests -Darguments=-DskipTests -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}
# Prepare for signing artifacts as part of release process
# NOTE: based on http://www.debonair.io/post/maven-cd/ "Encrypt cert and variables for travis"
- openssl aes-256-cbc -K $encrypted_4d75e2900770_key -iv $encrypted_4d75e2900770_iv -in travis/codesigning.asc.enc -out travis/codesigning.asc -d
- gpg --fast-import travis/codesigning.asc
# Perform mvn release steps
- mvn -Dmaven.wagon.http.retryHandler.count=3 --batch-mode release:prepare -DskipTests -Darguments=-DskipTests -DtagNameFormat="v@{project.version}" -DscmCommentPrefix="[maven-release-plugin][skip travis]" # NOTE: this stop's travis from building based on the tag's commit/push.
- mvn -Dmaven.wagon.http.retryHandler.count=3 --batch-mode release:perform -DskipTests -Darguments=-DskipTests