-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy path.travis.yml
116 lines (100 loc) · 3.13 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
language: java
sudo: required
dist: trusty
group: edge
addons:
sonarcloud:
organization: trellis-ldp
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
- rm -f $HOME/.gradle/caches/*/fileHashes/fileHashes.bin
- rm -f $HOME/.gradle/caches/*/fileHashes/fileHashes.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
stages:
- test
- deploy
branches:
only:
- master
# release tags
- /^trellis-\d+\.\d+\.\d+$/
# maintenance branches
- /^trellis-\d+\.\d+\.x$/
# long-lived branches
- /branch-.+/
env:
- JOB=check
jobs:
fast_finish: true
allow_failures:
- env: JOB=sonatype
- env: JOB=docker
- env: JOB=aws
- env: JOB=jpms
- env: JOB=osgi
include:
# JDK 8
- name: "Java 8"
stage: test
jdk: openjdk8
script: travis_retry ./gradlew check install jacocoRootReport -x pmdMain -x spotbugsMain --scan
after_success: ./gradlew coveralls sonarqube
# JDK 11
- name: "Java 11"
stage: test
jdk: openjdk11
dist: xenial
script: travis_retry ./gradlew check install -x pmdMain -x spotbugsMain
# JDK 8 (OSGi)
- name: "Java 8 (OSGi)"
stage: test
jdk: openjdk8
env: JOB=osgi
script: ./gradlew -p platform/osgi -x pmdMain -x spotbugsMain check -Posgi
# JDK 11 (modules)
- name: "Java 11 (modules)"
stage: test
jdk: openjdk11
dist: xenial
env: JOB=jpms
install: ./gradlew assemble -Pjpms
script: travis_retry ./gradlew check install -x pmdMain -x spotbugsMain -Pjpms
# deploy JDK 8 builds to Sonatype
- name: "Publish to Sonatype"
stage: deploy
jdk: openjdk8
env: JOB=sonatype
if: branch = trellis-0.9.x AND type = push
# Only automate the publication of SNAPSHOTS
script: if [[ $(./gradlew -q getVersion) == *SNAPSHOT* ]]; then ./gradlew publish ; fi
# deploy to Docker hub
- name: "Publish to Docker hub"
stage: deploy
jdk: openjdk8
if: (branch = trellis-0.9.x OR branch =~ /^trellis-\d+\.\d+\.\d+$/) AND type = push
env: JOB=docker
before_script: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Note: for maintenance branches, remove the dockerPushDevelop task
script:
- if [[ $(./gradlew -q getVersion) == *SNAPSHOT* ]]; then ./gradlew dockerPush; else ./gradlew dockerPush dockerPushLatest; fi
- ./buildtools/src/main/resources/docker/publishToDockerHub.sh
# deploy to AWS
- name: "Publish JavaDocs"
stage: deploy
jdk: openjdk8
env: JOB=aws
if: (branch = trellis-0.9.x OR branch =~ /^trellis-\d+\.\d+\.\d+$/) AND type = push
script: ./gradlew apidocs
deploy:
provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
bucket: $AWS_BUCKET
skip_cleanup: true
local_dir: docs/apidocs/$(./gradlew -q getVersion)
upload-dir: docs/trellis/$(./gradlew -q getVersion)/apidocs
default_text_charset: 'utf-8'