-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
269 lines (245 loc) · 9.3 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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
stages:
- source
- binary
srpm:
stage: source
image: fedora:38
before_script:
# Fedora decided that restricting mirrors don't exist :-/
- sed -i -e 's,^metalink=.*repo=fedora-.releasever.arch=.basearch$,baseurl=https://ftp.halifax.rwth-aachen.de/fedora/linux/releases/$releasever/Everything/$basearch/os/,g' /etc/yum.repos.d/fedora.repo; cat /etc/yum.repos.d/fedora.repo
- sed -i -e 's,^metalink=.*repo=updates-released-f.releasever.arch=.basearch$,baseurl=https://ftp.halifax.rwth-aachen.de/fedora/linux/updates/$releasever/Everything/$basearch/,g' /etc/yum.repos.d/fedora-updates.repo; cat /etc/yum.repos.d/fedora-updates.repo
- sed -i -e 's,^metalink=.*repo=fedora-modular-.releasever.arch=.basearch$,baseurl=https://ftp.halifax.rwth-aachen.de/fedora/linux/releases/$releasever/Modular/$basearch/os/,g' /etc/yum.repos.d/fedora-modular.repo; cat /etc/yum.repos.d/fedora-modular.repo
- sed -i -e 's,^metalink=.*repo=updates-released-modular-f.releasever.arch=.basearch$,baseurl=https://ftp.halifax.rwth-aachen.de/fedora/linux/updates/$releasever/Modular/$basearch/,g' /etc/yum.repos.d/fedora-updates-modular.repo; cat /etc/yum.repos.d/fedora-updates-modular.repo
- dnf install -y git rpm-build rpmdevtools
- rpmdev-setuptree
- VER=$(git describe --always | sed -e 's/-/./g')
- mkdir -p products/tar
- git archive --prefix=beidconnect-$VER/ -o products/tar/beidconnect-$VER.tar.gz origin/$CI_COMMIT_REF_NAME
- cp products/tar/beidconnect-$VER.tar.gz ~/rpmbuild/SOURCES/
- echo $VER > products/version
- COMMIT_DATE=$(git log --date=rfc HEAD^..HEAD|grep ^Date|cut -d ' ' -f 2-|sed -e 's/^\s*//')
- echo $COMMIT_DATE > products/date
script:
- rpmbuild --define "version $VER" -bs linux/beidconnect.spec
after_script:
- mkdir -p products/srpm
- cp ~/rpmbuild/SRPMS/beidconnect-*.src.rpm products/srpm/
artifacts:
paths:
- products
when:
on_success
.build:fedora: &fedbuild
stage: binary
image: fedora:38
dependencies:
- srpm
before_script:
# Fedora decided that restricting mirrors don't exist :-/
- sed -i -e 's,^metalink=.*repo=fedora-.releasever.arch=.basearch$,baseurl=https://ftp.halifax.rwth-aachen.de/fedora/linux/releases/$releasever/Everything/$basearch/os/,g' /etc/yum.repos.d/fedora.repo; cat /etc/yum.repos.d/fedora.repo
- sed -i -e 's,^metalink=.*repo=updates-released-f.releasever.arch=.basearch$,baseurl=https://ftp.halifax.rwth-aachen.de/fedora/linux/updates/$releasever/Everything/$basearch/,g' /etc/yum.repos.d/fedora-updates.repo; cat /etc/yum.repos.d/fedora-updates.repo
- sed -i -e 's,^metalink=.*repo=fedora-modular-.releasever.arch=.basearch$,baseurl=https://ftp.halifax.rwth-aachen.de/fedora/linux/releases/$releasever/Modular/$basearch/os/,g' /etc/yum.repos.d/fedora-modular.repo; cat /etc/yum.repos.d/fedora-modular.repo
- sed -i -e 's,^metalink=.*repo=updates-released-modular-f.releasever.arch=.basearch$,baseurl=https://ftp.halifax.rwth-aachen.de/fedora/linux/updates/$releasever/Modular/$basearch/,g' /etc/yum.repos.d/fedora-updates-modular.repo; cat /etc/yum.repos.d/fedora-updates-modular.repo
- dnf -y install mock git rpm-build rpmdevtools
- VER=$(cat products/version)
- sed -i -e 's,^metalink=.*repo=fedora-.releasever.arch=.basearch$,baseurl=https://ftp.halifax.rwth-aachen.de/fedora/linux/releases/$releasever/Everything/$basearch/os/,g' /etc/mock/templates/fedora-branched.tpl
- sed -i -e 's,^metalink=.*repo=updates-released-f.releasever.arch=.basearch$,baseurl=https://ftp.halifax.rwth-aachen.de/fedora/linux/updates/$releasever/Everything/$basearch/,g' /etc/mock/templates/fedora-branched.tpl; cat /etc/mock/templates/fedora-branched.tpl
- sed -i -e 's,^mirrorlist=.*repo=epel-7.arch=.basearch,baseurl=https://ftp.halifax.rwth-aachen.de/fedora-epel/$releasever/$basearch/,g' /etc/mock/templates/epel-7.tpl; cat /etc/mock/templates/epel-7.tpl
- sed -i -e 's,^mirrorlist=.*repo=epel-8.arch=.basearch,baseurl=https://ftp.halifax.rwth-aachen.de/fedora-epel/$releasever/Everything/$basearch/,g' /etc/mock/templates/epel-8.tpl; cat /etc/mock/templates/epel-8.tpl
- sed -i -e 's,^metalink=.*repo=epel-$releasever.arch=.basearch,baseurl=https://ftp.halifax.rwth-aachen.de/fedora-epel/$releasever/Everything/$basearch/,g' /etc/mock/templates/epel-9.tpl; cat /etc/mock/templates/epel-9.tpl
script:
- mock --old-chroot --verbose -r $DIST-$VERSION-$ARCH --define "version $VER" --rebuild products/srpm/beidconnect-*.src.rpm --resultdir $CI_PROJECT_DIR/products/$DIST-$VERSION-$ARCH
artifacts:
name: "beidconnect-build-$DIST-$VERSION-$ARCH"
paths:
- products/$DIST-$VERSION-$ARCH
when:
on_success
.build:deb: &debuild
stage: binary
image: tianon/sbuild:latest
dependencies:
# We don't actually need the srpms, but we do need the version file. Although that could be done in a separate job, having them together seems easier.
- srpm
before_script:
- apt-get update; apt-get -y install devscripts dpkg-dev git debhelper
- sbuild-createchroot --arch=$ARCH $CODE /srv/chroot/$CODE $MIRROR $SCRIPT
- VER=$(cat products/version)
- if [ $ARCH = "i386" ]; then DASHA="-A -s"; else DASHA="--no-arch-all --no-source"; fi
- export DASHA
- if [ ! -z "$http_proxy" ]; then echo "Acquire::http::Proxy \"$http_proxy\";" > /srv/chroot/$CODE/etc/apt/apt.conf.d/99proxy; fi
- ./linux/deb-cl.pl "$VER" "$CODE" "$SHORT"
script:
- sbuild -n $DASHA -c $CODE-$ARCH-sbuild --arch=$ARCH
after_script:
- mkdir -p products/deb/$CODE/$ARCH
- dcmd cp ../*ges products/deb/$CODE/$ARCH
artifacts:
name: "beidconnect-build-$SHORT-$CODE-$ARCH"
paths:
- products/deb
when:
on_success
.build:ubuntu: &ubbuild
stage: binary
image: ubuntu:latest
dependencies:
# We don't actually need the srpms, but we do need the version file. Although that could be done in a separate job, having them together seems easier.
- srpm
before_script:
- apt-get update; apt-get -y install devscripts dpkg-dev git debhelper zstd sbuild schroot debootstrap
- sbuild-createchroot --arch=$ARCH $CODE /srv/chroot/$CODE $MIRROR $SCRIPT
- VER=$(cat products/version)
- if [ $ARCH = "i386" ]; then DASHA="-A -s"; else DASHA="--no-arch-all --no-source"; fi
- export DASHA
- if [ ! -z "$http_proxy" ]; then echo "Acquire::http::Proxy \"$http_proxy\";" > /srv/chroot/$CODE/etc/apt/apt.conf.d/99proxy; fi
- ./linux/deb-cl.pl "$VER" "$CODE" "$SHORT"
script:
- sbuild -n $DASHA -c $CODE-$ARCH-sbuild --arch=$ARCH
after_script:
- mkdir -p products/deb/$CODE/$ARCH
- dcmd cp ../*ges products/deb/$CODE/$ARCH
artifacts:
name: "beidconnect-build-$SHORT-$CODE-$ARCH"
paths:
- products/deb
when:
on_success
build:fedora-37-64:
<<: *fedbuild
variables:
VERSION: 37
ARCH: x86_64
DIST: fedora
build:fedora-37-32:
<<: *fedbuild
variables:
VERSION: 37
ARCH: i386
DIST: fedora
build:fedora-38-64:
<<: *fedbuild
variables:
VERSION: 38
ARCH: x86_64
DIST: fedora
build:fedora-38-32:
<<: *fedbuild
variables:
VERSION: 38
ARCH: i386
DIST: fedora
build:fedora-39-64:
<<: *fedbuild
variables:
VERSION: 39
ARCH: x86_64
DIST: fedora
build:fedora-39-32:
<<: *fedbuild
variables:
VERSION: 39
ARCH: i386
DIST: fedora
build:centos-stream-9-64:
<<: *fedbuild
variables:
VERSION: 9
ARCH: x86_64
DIST: centos-stream
build:centos-7-64:
<<: *fedbuild
variables:
VERSION: 7
ARCH: x86_64
DIST: centos
build:debian-10-32:
<<: *debuild
variables:
CODE: buster
SHORT: deb10
ARCH: i386
MIRROR: http://deb.debian.org/debian
build:debian-10-64:
<<: *debuild
variables:
CODE: buster
SHORT: deb10
ARCH: amd64
MIRROR: http://deb.debian.org/debian
build:debian-11-32:
<<: *debuild
variables:
CODE: bullseye
SHORT: deb11
ARCH: i386
MIRROR: http://deb.debian.org/debian
build:debian-11-64:
<<: *debuild
variables:
CODE: bullseye
SHORT: deb11
ARCH: amd64
MIRROR: http://deb.debian.org/debian
build:debian-12-32:
<<: *debuild
variables:
CODE: bookworm
SHORT: deb12
ARCH: i386
MIRROR: http://deb.debian.org/debian
build:debian-12-64:
<<: *debuild
variables:
CODE: bookworm
SHORT: deb12
ARCH: amd64
MIRROR: http://deb.debian.org/debian
build:ubuntu-2204-64:
<<: *ubbuild
variables:
CODE: jammy
ARCH: amd64
SHORT: u2204
MIRROR: http://archive.ubuntu.com/ubuntu
SCRIPT: /usr/share/debootstrap/scripts/gutsy
build:ubuntu-2204-32:
<<: *ubbuild
variables:
CODE: jammy
ARCH: i386
SHORT: u2204
MIRROR: http://archive.ubuntu.com/ubuntu
SCRIPT: /usr/share/debootstrap/scripts/gutsy
build:ubuntu-2004-64:
<<: *debuild
variables:
CODE: focal
ARCH: amd64
SHORT: u2004
MIRROR: http://archive.ubuntu.com/ubuntu
SCRIPT: /usr/share/debootstrap/scripts/gutsy
build:ubuntu-2004-32:
<<: *debuild
variables:
CODE: focal
ARCH: i386
SHORT: u2004
MIRROR: http://archive.ubuntu.com/ubuntu
SCRIPT: /usr/share/debootstrap/scripts/gutsy
build:ubuntu-1804-64:
<<: *debuild
variables:
CODE: bionic
ARCH: amd64
SHORT: u1804
MIRROR: http://archive.ubuntu.com/ubuntu
SCRIPT: /usr/share/debootstrap/scripts/gutsy
build:ubuntu-1804-32:
<<: *debuild
variables:
CODE: bionic
ARCH: i386
SHORT: u1804
MIRROR: http://archive.ubuntu.com/ubuntu
SCRIPT: /usr/share/debootstrap/scripts/gutsy