-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
157 lines (141 loc) · 5.47 KB
/
.gitlab-ci.yml
File metadata and controls
157 lines (141 loc) · 5.47 KB
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
variables:
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
- .m2/repository
stages:
- build
- test
- build-docker
build-nginx-docker:
stage: build-docker
needs: []
before_script:
- cd nginx-config
- export VERSION=$(cat version.txt)
- docker login -u martenls -p $DOCKER_REGISTRY_TOKEN $CI_REGISTRY
script:
- docker build -t $CI_REGISTRY/martenls/bachelor-thesis-code/nginx-openbot:$VERSION -t $CI_REGISTRY/martenls/bachelor-thesis-code/nginx-openbot .
- docker push $CI_REGISTRY/martenls/bachelor-thesis-code/nginx-openbot
- docker push $CI_REGISTRY/martenls/bachelor-thesis-code/nginx-openbot:$VERSION
after_script:
- docker logout $CI_REGISTRY
tags:
- shared
only:
changes:
- nginx-config/version.txt
# build-twitter-docker:
# stage: build-docker
# before_script:
# - cd sninterface-twitter
# - export VERSION=$(cat version.txt)
# - docker login -u martenls -p $DOCKER_REGISTRY_TOKEN $CI_REGISTRY
# script:
# - docker build -t $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-twitter:$VERSION -t $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-twitter .
# - docker push $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-twitter
# - docker push $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-twitter:$VERSION
# after_script:
# - docker logout $CI_REGISTRY
# tags:
# - shared
# only:
# changes:
# - sninterface-twitter/version.txt
build-qasystem:
stage: build
image: maven:3-openjdk-11
before_script:
- cd dcat-qa-system
script:
- mvn $MAVEN_CLI_OPTS -DskipTests package
artifacts:
paths:
- dcat-qa-system/target/*.jar
tags:
- shared
test-qasystem:
stage: test
image: maven:3-openjdk-11
services:
- name: elasticsearch:7.7.0
alias: es
command: [ "bin/elasticsearch", "-Ediscovery.type=single-node" ]
before_script:
- cd dcat-qa-system
script:
- mvn $MAVEN_CLI_OPTS -Des.host=es -Des.port=9200 org.jacoco:jacoco-maven-plugin:0.8.5:prepare-agent test org.jacoco:jacoco-maven-plugin:0.8.5:report
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/",instructions, "instructions covered"; print 100*covered/instructions, "%covered" }' target/site/jacoco/jacoco.csv
artifacts:
paths:
- dcat-qa-system/target/*.jar
reports:
junit:
- target/surefire-reports/TEST-*.xml
coverage: '/Code coverage: \d+.\d+ \% covered/'
tags:
- openbot
build-qasystem-docker:
stage: build-docker
needs:
- job: test-qasystem
artifacts: true
before_script:
- cd dcat-qa-system
- export VERSION=$(cat version.txt)
- docker login -u martenls -p $DOCKER_REGISTRY_TOKEN $CI_REGISTRY
script:
- docker build -t $CI_REGISTRY/martenls/bachelor-thesis-code/qa-system:$VERSION -t $CI_REGISTRY/martenls/bachelor-thesis-code/qa-system .
- docker push $CI_REGISTRY/martenls/bachelor-thesis-code/qa-system
- docker push $CI_REGISTRY/martenls/bachelor-thesis-code/qa-system:$VERSION
after_script:
- docker logout $CI_REGISTRY
tags:
- shared
only:
changes:
- dcat-qa-system/version.txt
build-sninterface-botkit-twitter-docker:
stage: build-docker
needs: []
before_script:
- cd sninterface-botkit/twitter-bot
- export VERSION=$(cat version.txt)
- docker login -u martenls -p $DOCKER_REGISTRY_TOKEN $CI_REGISTRY
script:
- docker build -t $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-botkit-twitter:$VERSION -t $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-botkit-twitter .
- docker push $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-botkit-twitter
- docker push $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-botkit-twitter:$VERSION
after_script:
- docker logout $CI_REGISTRY
tags:
- shared
only:
changes:
- sninterface-botkit/twitter-bot/version.txt
build-sninterface-botkit-web-docker:
stage: build-docker
needs: []
before_script:
- cd sninterface-botkit/web-bot
- export VERSION=$(cat version.txt)
- docker login -u martenls -p $DOCKER_REGISTRY_TOKEN $CI_REGISTRY
script:
- docker build -t $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-botkit-web:$VERSION -t $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-botkit-web .
- docker push $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-botkit-web
- docker push $CI_REGISTRY/martenls/bachelor-thesis-code/sninterface-botkit-web:$VERSION
after_script:
- docker logout $CI_REGISTRY
tags:
- shared
only:
changes:
- sninterface-botkit/web-bot/version.txt