-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
68 lines (64 loc) · 3.48 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
67
68
language: java
jdk:
- openjdk17
git:
# To help SonarCloud understand history
depth: false
dist: focal
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
jobs:
include:
- stage: test
addons:
sonarcloud:
organization: "susom"
token:
secure: "n9/rZAF6gptZ5EHiyxAHBuAkKGHT/GoJXSem+J8ITCzWtra/ZWwCQOhqmZp1v0xqmcTKzopRkQ5tA1VwEgU/JQIcdYIqcfifzduSVVOsBOlwr/VlIGHWmHPMaQ2QX+rvUlbK+ffexhrFuNo4DtTD0j2bpuK/2s9HtZArazejLPLY7qK29iKCe0GZ2gaMgZoQikCGf/Bga5nJSXaQ/gA9URwH8bsYkty5uJVGGsjg+bniy7OnmVgYwZU0dgS0+NgnEbQM5QH2ZMpihTPo8VgP3/5QAsrDyGteziJ/mEi8/4wpd0cSdmLmbwmgobDMsj3w6LqaPEOw1li3wz+q4goUQiYTKPbNkiWpyjzjC6sTfj9UkQUX6+m6V2iqEZe3qGqJYfFadmAR4jaC6J/0lHuCKNfWcz/Bn0Q8Gdj1lsHG6duzriYhWzGQ4MX0QMmmKM6lEG9yk6yJX38oG+b5UDrBZ4xFLvjaal0e7wwG/tr1T2eijQYdRVd/eGcEIvMNw9csWdz4E2+Xjm0pG/rGq2OrkJl6gPKNfgVGr6A4SS9bW/kgemTcQSK5ibQqo6+7mXWg5filvKSk8sHsey0mrtxSJsn9lckXsbyNZ6cf5WK8pKPIbChe7D47JO5tMrTwaeH4hrj/UshMyQKyeKNnwCFSWjQw+OGmx5nYaYtpvoMkLJI="
# Skip the default mvn command because we want to set the profile explicitly
install: true
script:
- echo "test"
- mvn -e -Pcoverage verify sonar:sonar -Dsonar.projectKey=susom_vertx-base
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