-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
231 lines (214 loc) · 5.62 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
workflow:
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
- if: $CI_MERGE_REQUEST_IID
#image:
# name: debian:stable
services:
- docker:18-dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- build
stages:
- build
- test
- deploy
build-debian-11:
image: debian:bullseye
variables:
GIT_SUBMODULE_STRATEGY: recursive
stage: build
before_script:
- apt -y update
- apt -y install cmake gcc g++
- apt -y install libcurl4-openssl-dev libssl-dev
- apt -y install dpkg-dev file libgmp-dev
- apt -y install libunistring-dev
script:
- cmake -S. -Bbuild
- cmake --build build -- -j$(nproc)
- cmake --build build --target package -- -j$(nproc)
cache:
key: "debian-11-${CI_COMMIT_REF_SLUG}"
paths:
- build
build-debian-12:
image: debian:bookworm
variables:
GIT_SUBMODULE_STRATEGY: recursive
stage: build
before_script:
- apt -y update
- apt -y install cmake gcc g++
- apt -y install libcurl4-openssl-dev libssl-dev
- apt -y install dpkg-dev file libgmp-dev
- apt -y install libunistring-dev
script:
- cmake -S. -Bbuild
- cmake --build build -- -j$(nproc)
- cmake --build build --target package -- -j$(nproc)
cache:
key: "debian-12-${CI_COMMIT_REF_SLUG}"
paths:
- build
build-centos-9-stream:
image: quay.io/centos/centos:stream9
variables:
GIT_SUBMODULE_STRATEGY: recursive
stage: build
before_script:
- yum -y update
- yum install -y gcc gcc-c++ make gmp-c++ gmp-devel
- yum install -y openssl-devel libcurl-devel file rpm-build cmake
- cd /tmp
- curl -LOJ https://mirror.stream.centos.org/9-stream/CRB/x86_64/os/Packages/libunistring-devel-0.9.10-15.el9.x86_64.rpm
- yum install -y ./libunistring*.rpm
- rm -f ./lib*.rpm
- cd -
script:
- cmake -S. -Bbuild
- cmake --build build -- -j$(nproc)
- cmake --build build --target package -- -j$(nproc)
cache:
key: "centos-${CI_COMMIT_REF_SLUG}"
paths:
- build
test-debian-11:
image: debian:bullseye
stage: test
before_script:
- apt -y update
- apt -y install libcurl4 libssl1.1
script:
- ldd build/src/test/unittests
- build/src/test/unittests
- ldd build/src/test/test_performance
- ls -l build/src/test src/test/DATA
- build/src/test/test_performance_c
- build/src/test/test_performance
cache:
key: "debian-11-${CI_COMMIT_REF_SLUG}"
paths:
- build
test-debian-12:
image: debian:bookworm
stage: test
before_script:
- apt -y update
- apt -y install libcurl4 libssl3
script:
- ldd build/src/test/unittests
- build/src/test/unittests
- ldd build/src/test/test_performance
- ls -l build/src/test src/test/DATA
- build/src/test/test_performance_c
- build/src/test/test_performance
cache:
key: "debian-12-${CI_COMMIT_REF_SLUG}"
paths:
- build
test-centos-9-stream:
image: quay.io/centos/centos:stream9
stage: test
script:
- ldd build/src/test/unittests
- build/src/test/unittests
- ldd build/src/test/test_performance
- ls -l build/src/test src/test/DATA
- build/src/test/test_performance_c
- build/src/test/test_performance
cache:
key: "centos-${CI_COMMIT_REF_SLUG}"
paths:
- build
sast:
variables:
SAST_EXCLUDED_PATHS: src/test, build
stage: test
include:
- template: Security/SAST.gitlab-ci.yml
# package-centos:
# stage: deploy
# cache:
# key: "centos-${CI_COMMIT_REF_SLUG}"
# paths:
# - build
# script:
# - ls build/*.rpm
# artifacts:
# paths:
# - build/*.rpm
# only:
# - master
# - tags
# except:
# - schedules
package-debian-11:
image: debian:bullseye
stage: deploy
artifacts:
paths:
- build/*.deb
script:
- ls build/*.deb
only:
- UB1-980_Debian_bookworm_port
- master
- tags
except:
- schedules
cache:
key: "debian-11-${CI_COMMIT_REF_SLUG}"
paths:
- build
package-debian-12:
image: debian:bookworm
stage: deploy
artifacts:
paths:
- build/*.deb
script:
- ls build/*.deb
only:
- UB1-980_Debian_bookworm_port
- master
- tags
except:
- schedules
cache:
key: "debian-12-${CI_COMMIT_REF_SLUG}"
paths:
- build
deploy:
image: debian:bullseye
stage: deploy
before_script:
- apt -y update
- apt -y install docker.io
- docker login --username ${DOCKERHUB_USER} --password-stdin < ${DOCKERHUB_TOKEN}
script:
- docker build -t ubiqsecurity/ubiq-c-cpp-sample -f src/examples/Dockerfile .
- docker tag ubiqsecurity/ubiq-c-cpp-sample ubiqsecurity/ubiq-c-cpp-sample:${CI_COMMIT_TAG:-latest}
- docker push ubiqsecurity/ubiq-c-cpp-sample
after_script:
- docker logout
artifacts:
# gitlab will keep the most recent artifacts
# regardless of the expiration time
expire_in: 1 hour
paths:
- build/*.deb
only:
- master
- tags
except:
- schedules
cache:
key: "debian-11-${CI_COMMIT_REF_SLUG}"
paths:
- build