This repository has been archived by the owner on Nov 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
.gitlab-ci.yml
205 lines (175 loc) · 6.56 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
variables:
IMAGE_NAME: $REGISTRY_HOST/$CI_PROJECT_PATH
DOCKER_HUB_IMAGE_NAME: streampipes
MAVEN_CLI_OPTS: -DskipTests --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true
HARBOR_IMAGE_NAME: $HARBOR_REGISTRY_HOST/$CI_PROJECT_PATH
GIT_REPO_ORIGIN: $GIT_REPO_ORIGIN
GIT_STRATEGY: clone
stages:
- github
- build
- docker
pull github:
image: maven:3-jdk-8
stage: github
script:
- git remote set-url origin $GIT_REPO_ORIGIN/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME.git
- git remote add github https://github.com/apache/incubator-streampipes-extensions.git
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH")
- mkdir ~/.ssh
- touch ~/.ssh/known_hosts
- ssh-keyscan -p 2222 -t rsa $GITLAB_HOST > ~/.ssh/known_hosts
- git config --global user.email '$USER_EMAIL'
- git config --global user.name '$USER_NAME'
- git checkout dev
- git pull github dev --allow-unrelated-histories
- git push origin --all
build:
image: maven:3.6.1-jdk-8
stage: build
script:
- echo "$GPG_PRIVATE_KEY" | gpg --batch --import --passphrase "$GPG_PASSPHRASE"
- echo "$MAVEN_CREDENTIALS" > /root/.m2/settings.xml
- mvn clean package javadoc:aggregate -U -DskipTests -Denforcer.skip
- export MVN_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)
- echo $MVN_VERSION >> ./target/mvn_version
artifacts:
paths:
- ./*/target/*.jar
- ./streampipes-connect-adapters/streampipes-connect-adapter/target/*.jar
- ./target/mvn_version
expire_in: 1 hour
except:
- /release-.*$/
docker-connect-container:
image: docker:17.06.0-ce
stage: docker
dependencies:
- build
script:
- export MVN_VERSION=$(cat ./target/mvn_version)
- cd streampipes-connect-adapters/streampipes-connect-adapter
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $REGISTRY_HOST
- docker login -u $USER_EMAIL -p $HARBOR_PASSWORD $HARBOR_REGISTRY_HOST
- docker build --pull -t $IMAGE_NAME/streampipes-connect-worker:latest -t $IMAGE_NAME/streampipes-connect-worker:$MVN_VERSION -t $HARBOR_IMAGE_NAME/streampipes-connect-worker:latest -t $HARBOR_IMAGE_NAME/streampipes-connect-worker:$MVN_VERSION .
- docker push $IMAGE_NAME/streampipes-connect-worker:$MVN_VERSION
- docker push $IMAGE_NAME/streampipes-connect-worker:latest
- docker push $HARBOR_IMAGE_NAME/streampipes-connect-worker:$MVN_VERSION
- docker push $HARBOR_IMAGE_NAME/streampipes-connect-worker:latest
only:
- dev
.docker_script: &docker_script
image: docker:17.06.0-ce
stage: docker
dependencies:
- build
script:
- export MVN_VERSION=$(cat ./target/mvn_version)
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $REGISTRY_HOST
- docker login -u $USER_EMAIL -p $HARBOR_PASSWORD $HARBOR_REGISTRY_HOST
- docker build --no-cache --pull -t $IMAGE_NAME/$CONTAINER_NAME:latest -t $IMAGE_NAME/$CONTAINER_NAME:$MVN_VERSION -t $HARBOR_IMAGE_NAME/$CONTAINER_NAME:latest -t $HARBOR_IMAGE_NAME/$CONTAINER_NAME:$MVN_VERSION ./streampipes-$CONTAINER_NAME
- docker push $IMAGE_NAME/$CONTAINER_NAME:$MVN_VERSION
- docker push $IMAGE_NAME/$CONTAINER_NAME:latest
- docker push $HARBOR_IMAGE_NAME/$CONTAINER_NAME:$MVN_VERSION
- docker push $HARBOR_IMAGE_NAME/$CONTAINER_NAME:latest
only:
- dev
docker-pe-all-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "pipeline-elements-all-jvm"
docker-processors-aggregation-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-aggregation-flink"
docker-processors-enricher-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-enricher-flink"
docker-processors-enricher-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-enricher-jvm"
docker-processors-filters-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-filters-jvm"
docker-processors-geo-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-geo-jvm"
docker-processors-image-processing-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-image-processing-jvm"
docker-processors-pattern-detection-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-pattern-detection-flink"
docker-processors-filters-siddhi:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-filters-siddhi"
docker-processors-statistics-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-statistics-flink"
docker-processors-geo-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-geo-flink"
docker-processors-transformation-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-transformation-flink"
docker-processors-transformation-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-transformation-jvm"
docker-processors-text-mining-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-text-mining-jvm"
docker-sinks-brokers-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "sinks-brokers-jvm"
docker-sinks-databases-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "sinks-databases-flink"
docker-sinks-databases-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "sinks-databases-jvm"
docker-sinks-notifications-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "sinks-notifications-jvm"
docker-sinks-internal-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "sinks-internal-jvm"
docker-sources-vehicle-simulator:
<<: *docker_script
variables:
CONTAINER_NAME: "sources-vehicle-simulator"
docker-sources-watertank-simulator:
<<: *docker_script
variables:
CONTAINER_NAME: "sources-watertank-simulator"