-
Notifications
You must be signed in to change notification settings - Fork 18
/
.gitlab-ci.yml
127 lines (117 loc) · 3 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
stages:
- build
- test
- qa
- deploy
image: registry.johnnei.org:443/docker-images/maven:lts
variables:
MAVEN_OPTS: -Dmaven.repo.local=/cache/.repository
# Compile the code, must succeed before we start testing.
build:
tags: [ "docker" ]
stage: build
script: "mvn -B clean compile"
# Run the quick test suite (Unit tests mostly)
quicktests:
stage: test
tags: [ "docker" ]
script: "mvn -B test --fail-at-end"
artifacts:
expire_in: 1 week
paths:
- "**/target/site/jacoco/jacoco.xml"
- "**/target/surefire-reports/*.xml"
reports:
junit: "**/target/surefire-reports/*.xml"
# Run the integration test suite (Unit tests which don't use mocks and commonly exclude mock usages)
integration-tests:
stage: test
tags: [ "docker" ]
script: "mvn -B verify --fail-at-end -DskipUTs=true"
artifacts:
when: always
expire_in: 1 week
paths:
- "**/target/*.log"
- "**/target/site/jacoco-it/jacoco.xml"
- "**/target/failsafe-reports/*.xml"
reports:
junit: "**/target/failsafe-reports/*.xml"
# Run a sonar analysis.
sonarqube.johnnei.org:
stage: qa
tags: [ "docker" ]
script: "mvn -B compile test-compile sonar:sonar -Dsonar.host.url=https://sonarqube.johnnei.org -Dsonar.login=$SONAR_TOKEN"
only: ["develop"]
dependencies:
- quicktests
- integration-tests
site:
stage: qa
tags:
- docker
script:
- "mvn -B test-compile site:site"
only:
- develop
dependencies: []
needs:
- build
artifacts:
paths:
- "target/site/*"
- "target/site/css/*"
- "target/site/images/*"
- "target/site/images/logos/*"
pages:
stage: deploy
image: ruby:2.7.2
tags: [ "docker" ]
dependencies: []
needs: []
script:
- cd docs
- bundle install
- bundle exec jekyll build -d ../public
only: ["develop"]
artifacts:
paths:
- public
test deployment:
stage: test
script:
- "echo $GPG_PRIVATE_KEY | base64 -d | gpg --import --batch"
- "mkdir -p ~/.m2"
- "cp $OSSRH_SETTINGS ~/.m2/settings.xml"
- "mvn -B -Prelease -pl !bittorrent-integration-tests clean verify -DskipTests -Dgpg.passphrase=$GPG_PASS"
tags: [ "docker" ]
dependencies: [ ]
variables:
MAVEN_OPTS: ""
artifacts:
expire_in: 1 week
paths:
- "**/target/*.jar"
- "**/target/*.jar.asc"
only: [ "/^release\\/.*$/" ]
deploy to maven central:
stage: deploy
script:
- "echo $GPG_PRIVATE_KEY | base64 -d | gpg --import --batch"
- "mkdir -p ~/.m2"
- "cp $OSSRH_SETTINGS ~/.m2/settings.xml"
- "mvn -B -Prelease -pl !bittorrent-integration-tests clean deploy -DskipTests -Dgpg.passphrase=$GPG_PASS"
environment:
name: "MavenCentral"
url: "https://search.maven.org/search?q=g:org.johnnei%20javatorrent"
dependencies: [ ]
variables:
MAVEN_OPTS: ""
artifacts:
paths:
- "**/target/*.jar"
- "**/target/*.jar.asc"
when: manual
tags: [ "docker" ]
only:
- tags