-
Notifications
You must be signed in to change notification settings - Fork 98
/
.gitlab-ci.yml
178 lines (150 loc) · 5.05 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
image: $CI_REGISTRY/swe-database-team/gitlab-ci/whois-build:v0.0.5
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
ES_JAVA_OPTS: '-Xms1g -Xmx4g'
TZ: Europe/Amsterdam
WS_MAVEN_AGGREGATEMODULES: "true"
PROJECT_NAME: "whois"
ARTIFACT_NAME: "whois-db"
ARTIFACT_DIR: "whois-db"
GROUP_ID: "net.ripe.db"
include:
- project: 'swe-database-team/gitlab-ci'
file: '/templates/release-template.yml'
- project: 'swe-database-team/gitlab-ci'
file: '/templates/deployment-template.yml'
stages:
- build
- test
- integration-test
- code_quality
- release
- deploy
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .m2/repository
build:
tags:
- whois
stage: build
script:
- mvn $MAVEN_OPTS clean install -Prelease
artifacts:
paths:
- "*/target/*.jar"
expire_in: 6 months
reports:
junit:
- "*/target/surefire-reports/TEST-*.xml"
release:
stage: release
only:
- tags
script:
- if [ "$CI_COMMIT_TAG" ]; then NEW_VERSION="$CI_COMMIT_SHORT_SHA"; else NEW_VERSION="$CI_COMMIT_SHORT_SHA-SNAPSHOT"; fi
- mvn versions:set -DnewVersion=$NEW_VERSION
- mvn -DskipTests -DskipITs -Prelease deploy
extends: .release_template
.it_template: &it_env
tags:
- whois
stage: integration-test
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
when: always
- when: manual
allow_failure: true
artifacts:
reports:
junit:
- "*/target/failsafe-reports/TEST-*.xml"
.mariadb_template: &mariadb_configuration
variables:
MYSQL_ROOT_PASSWORD: root
TZ: Europe/Amsterdam
before_script:
- mysql -uroot -proot -h mariadb -e "CREATE USER 'dbint'@'%' IDENTIFIED BY '';"
- mysql -uroot -proot -h mariadb -e "GRANT ALL ON *.* TO 'dbint'@'%' WITH GRANT OPTION;"
- mysql -uroot -proot -h mariadb -e "SET GLOBAL innodb_file_per_table = 0;"
- mysql -uroot -proot -h mariadb -e "SET GLOBAL innodb_buffer_pool_size = 1073741824;"
- mysql -uroot -proot -h mariadb -e "SET GLOBAL max_connections=10000;"
services: &mariadb_service
- mariadb:10.2
whois-endtoend:
<<:
- *it_env
- *mariadb_configuration
script:
- mvn $MAVEN_OPTS -Ddb.host=mariadb verify -PintegrationAll -pl whois-endtoend
whois-api:
<<:
- *it_env
- *mariadb_configuration
services:
- *mariadb_service
- name: docker.elastic.co/elasticsearch/elasticsearch:7.16.3
alias: "elasticsearch"
command: [ "bin/elasticsearch", "-Expack.security.enabled=false", "-Ediscovery.type=single-node" ]
script:
- mvn $MAVEN_OPTS -Ddb.host=mariadb -Dtest.containers.disabled=true verify -PintegrationAll -pl whois-api
whois-client:
<<:
- *it_env
- *mariadb_configuration
script:
- mvn $MAVEN_OPTS -Ddb.host=mariadb verify -PintegrationAll -pl whois-client
whois-commons:
<<:
- *it_env
- *mariadb_configuration
script:
- mvn $MAVEN_OPTS -Ddb.host=mariadb verify -PintegrationAll -pl whois-commons -T 1
whois-db:
<<:
- *it_env
- *mariadb_configuration
script:
- mvn $MAVEN_OPTS -Ddb.host=mariadb verify -PintegrationAll -pl whois-db
whois-nrtm:
<<:
- *it_env
- *mariadb_configuration
script:
- mvn $MAVEN_OPTS -Ddb.host=mariadb verify -PintegrationAll -pl whois-nrtm
whois-query:
<<:
- *it_env
- *mariadb_configuration
script:
- mvn $MAVEN_OPTS -Ddb.host=mariadb verify -PintegrationAll -pl whois-query -T 1
whois-rpsl:
<<:
- *it_env
- *mariadb_configuration
script:
- mvn $MAVEN_OPTS -Ddb.host=mariadb verify -PintegrationAll -pl whois-rpsl
whois-scheduler:
<<:
- *it_env
- *mariadb_configuration
script:
- mvn $MAVEN_OPTS -Ddb.host=mariadb verify -PintegrationAll -pl whois-scheduler
whois-update:
<<:
- *it_env
- *mariadb_configuration
script:
- mvn $MAVEN_OPTS -Ddb.host=mariadb verify -PintegrationAll -pl whois-update
sonar:
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
stage: code_quality
only:
- schedules
tags:
- whois
script:
- echo PWD=$PWD
- mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectVersion=$CI_COMMIT_SHORT_SHA -Dsonar.projectKey=whois -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONAR_TOKEN} -Dsonar.projectName=whois -Dsonar.coverage.jacoco.xmlReportPaths=$PWD/whois-api/target/site/jacoco-merged-test-coverage-report/jacoco.xml,$PWD/whois-client/target/site/jacoco-merged-test-coverage-report/jacoco.xml,$PWD/whois-commons/target/site/jacoco-merged-test-coverage-report/jacoco.xml,$PWD/whois-db/target/site/jacoco-merged-test-coverage-report/jacoco.xml,$PWD/whois-nrtm/target/site/jacoco-merged-test-coverage-report/jacoco.xml,$PWD/whois-nrtm4/target/site/jacoco-merged-test-coverage-report/jacoco.xml,$PWD/whois-query/target/site/jacoco-merged-test-coverage-report/jacoco.xml,$PWD/whois-rpsl/target/site/jacoco-merged-test-coverage-report/jacoco.xml,$PWD/whois-scheduler/target/site/jacoco-merged-test-coverage-report/jacoco.xml -DskipITs -Dsonar.test.exclusions=**/test/*