-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
136 lines (124 loc) · 4.47 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
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:
stage: build
tags:
- dockerex
script: ./gradlew --build-cache assemble
artifacts:
paths:
- build/libs/*.jar
- record-bridge-raritan/build/libs/*.jar
- record-bridge-raritan/build/distributions/*.tar
- record-bridge-raritan/raritan-simulator/build/libs/*.jar
- record-bridge-raritan/raritan-simulator/build/distributions/*.tar
- load-tester-bridge/build/libs/*.jar
- load-tester-bridge/build/distributions/*.tar
expire_in: 1 day
test:
stage: test
tags:
- dockerex
script: ./gradlew test
checkstyle:
stage: check
tags:
- dockerex
script: ./gradlew checkstyle
pmd:
stage: check
tags:
- dockerex
script: ./gradlew pmd
spotbugs:
stage: check
tags:
- dockerex
script: ./gradlew spotbugs
deploy-raritan-bridge:
stage: deploy
tags:
- dockerex
# see https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
# for image usage and settings for building with TLS and docker in docker
image: docker:19.03.1
services:
- docker:19.03.1-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
script:
- DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//')
- docker build --pull -t titan-ccp-kieker-bridge-raritan ./record-bridge-raritan
- docker tag titan-ccp-kieker-bridge-raritan industrialdevops/titan-ccp-kieker-bridge-raritan:${DOCKER_TAG_NAME}latest
- docker tag titan-ccp-kieker-bridge-raritan industrialdevops/titan-ccp-kieker-bridge-raritan:$DOCKER_TAG_NAME$(date +%Y%m%d%H%M%S)
- docker tag titan-ccp-kieker-bridge-raritan industrialdevops/titan-ccp-kieker-bridge-raritan:$DOCKER_TAG_NAME$CI_COMMIT_SHA
- echo $DOCKERHUB_PW | docker login -u $DOCKERHUB_ID --password-stdin
- docker push industrialdevops/titan-ccp-kieker-bridge-raritan
- docker logout
only:
variables:
- $DOCKERHUB_ID
- $DOCKERHUB_PW
deploy-raritan-simulator:
stage: deploy
tags:
- dockerex
# see https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
# for image usage and settings for building with TLS and docker in docker
image: docker:19.03.1
services:
- docker:19.03.1-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
script:
- DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//')
- docker build --pull -t titan-ccp-raritan-simulator ./record-bridge-raritan/raritan-simulator
- docker tag titan-ccp-raritan-simulator industrialdevops/titan-ccp-raritan-simulator:${DOCKER_TAG_NAME}latest
- docker tag titan-ccp-raritan-simulator industrialdevops/titan-ccp-raritan-simulator:$DOCKER_TAG_NAME$(date +%Y%m%d%H%M%S)
- docker tag titan-ccp-raritan-simulator industrialdevops/titan-ccp-raritan-simulator:$DOCKER_TAG_NAME$CI_COMMIT_SHA
- echo $DOCKERHUB_PW | docker login -u $DOCKERHUB_ID --password-stdin
- docker push industrialdevops/titan-ccp-raritan-simulator
- docker logout
only:
variables:
- $DOCKERHUB_ID
- $DOCKERHUB_PW
deploy-load-tester-bridge:
stage: deploy
tags:
- dockerex
# see https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
# for image usage and settings for building with TLS and docker in docker
image: docker:19.03.1
services:
- docker:19.03.1-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
script:
- DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//')
- docker build --pull -t titan-ccp-load-tester-bridge ./load-tester-bridge
- docker tag titan-ccp-load-tester-bridge industrialdevops/titan-ccp-load-tester-bridge:${DOCKER_TAG_NAME}latest
- docker tag titan-ccp-load-tester-bridge industrialdevops/titan-ccp-load-tester-bridge:$DOCKER_TAG_NAME$(date +%Y%m%d%H%M%S)
- docker tag titan-ccp-load-tester-bridge industrialdevops/titan-ccp-load-tester-bridge:$DOCKER_TAG_NAME$CI_COMMIT_SHA
- echo $DOCKERHUB_PW | docker login -u $DOCKERHUB_ID --password-stdin
- docker push industrialdevops/titan-ccp-load-tester-bridge
- docker logout
only:
variables:
- $DOCKERHUB_ID
- $DOCKERHUB_PW