-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
108 lines (97 loc) · 2.2 KB
/
.gitlab-ci.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
image: openjdk:11-jdk
# Disable the Gradle daemon for Continuous Integration servers as correctness
# is usually a priority over speed in CI environments. Using a fresh
# runtime for each build is more reliable since the runtime is completely
# isolated from any previous builds.
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
cache:
paths:
- .gradle
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
stages:
- build
- test
- check
- deploy
# Build
build:
stage: build
tags:
- dockerex
script: ./gradlew --build-cache assemble
artifacts:
paths:
- build/libs
- "*/build/libs"
expire_in: 1 day
# Tests
test-except-cassandra:
stage: test
tags:
- dockerex
script: "./gradlew test --continue -x titanccp-common-cassandra:test"
artifacts:
reports:
junit:
- "build/test-results/test/TEST-*.xml"
- "**/build/test-results/test/TEST-*.xml"
expire_in: 28 day
# Own test for cassandra, because it requires java 8
test-cassandra:
stage: test
tags:
- dockerex
image: openjdk:8-jdk
script: "./gradlew titanccp-common-cassandra:test"
artifacts:
reports:
junit: titanccp-common-cassandra/build/test-results/test/TEST-*.xml
expire_in: 28 days
# Checks
checkstyle:
stage: check
tags:
- dockerex
script: ./gradlew --continue checkstyle
artifacts:
paths:
- build/reports/checkstyle/main.html
- "*/build/reports/checkstyle/main.html"
when: on_failure
expire_in: 28 days
pmd:
stage: check
tags:
- dockerex
script: ./gradlew --continue pmd
artifacts:
paths:
- build/reports/pmd/*.html
- "*/build/reports/pmd/*.html"
when: on_failure
expire_in: 28 days
spotbugs:
stage: check
tags:
- dockerex
script: ./gradlew --continue spotbugs
artifacts:
paths:
- build/reports/spotbugs/*.html
- "*/build/reports/spotbugs/*.html"
when: on_failure
expire_in: 28 days
deploy:
stage: deploy
tags:
- dockerex
script: ./gradlew publish -PsonatypeUsername=$OSSRH_JIRA_USERNAME -PsonatypePassword=$OSSRH_JIRA_PASSWORD
only:
refs:
- master
- v0.0
variables:
- $OSSRH_JIRA_PASSWORD
- $OSSRH_JIRA_USERNAME