-
Notifications
You must be signed in to change notification settings - Fork 18
/
.gitlab-ci.yml
242 lines (216 loc) · 5.34 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
image: "debian:stretch"
stages:
- docbuild
- build
- publish
# - test
- deploy
### build ###
docbuild:docs:
stage: docbuild
image: "tianon/latex"
script:
- apt-get update -qq
- apt-get install -y --no-install-recommends make sphinx-common python3-sphinx python3-recommonmark python3-sphinx-rtd-theme
- make docs
artifacts:
paths:
- doc/_build/html
build:stretch: &build
stage: build
script:
- apt-get update -qq
- apt-get -y --no-install-recommends build-dep ./
- apt-get -y --no-install-recommends install devscripts
- ci/rebuild.sh $dist $is_release
- make deb BUILD_ARGS=-Pstretch
- mkdir -p debs
- mv ../*.* debs
variables:
dist: deb9
artifacts:
expire_in: 2 weeks
paths:
- debs/*
- lintian.log
build:stretch-release:
<<: *build
variables:
dist: deb9
is_release: release
when: manual
build:buster: &build_buster
<<: *build
image: "debian:buster"
script:
- apt-get update -qq
- apt-get -y --no-install-recommends build-dep ./
- apt-get -y --no-install-recommends install devscripts
- ci/rebuild.sh $dist $is_release
- make deb
- mkdir -p debs
- mv ../*.* debs
variables:
dist: deb10
build:buster-release:
<<: *build_buster
variables:
dist: deb10
is_release: release
when: manual
build:bionic: &build_bionic
<<: *build_buster
variables:
dist: ubuntu18.04
build:bionic-release:
<<: *build_bionic
variables:
dist: ubuntu18.04
is_release: release
when: manual
build:centos7: &build_centos7
image: "centos:centos7"
stage: build
dependencies:
- docbuild:docs
script:
- yum install -y rpm-build yum-utils git make
- yum-builddep -y rpm/elephant-shed.spec
- make rpmbuild PACKAGE_RELEASE=1~$(date -u +%Y%m%d.%H%M%S)
artifacts:
expire_in: 2 weeks
paths:
- rpm/RPMS/*/*
- rpm/SRPMS/*
build:centos7-release:
<<: *build_centos7
script:
- yum install -y rpm-build yum-utils git make
- yum-builddep -y rpm/elephant-shed.spec
- make rpmbuild
when: manual
### publish ###
publish:stretch: &publish
tags:
- aptly
stage: publish
dependencies:
- build:stretch
script:
- aptly repo add $repo debs/*.dsc debs/*.deb
- aptly publish update $repo
- sync_packages.sh
variables:
repo: stretch-test
only:
- master
- rel1_3
publish:stretch-release:
<<: *publish
dependencies:
- build:stretch-release
variables:
repo: stretch-stable
when: manual
publish:buster: &publish_buster
<<: *publish
dependencies:
- build:buster
variables:
repo: buster-test
publish:buster-release:
<<: *publish_buster
dependencies:
- build:buster-release
variables:
repo: buster-stable
when: manual
publish:bionic: &publish_bionic
<<: *publish
dependencies:
- build:bionic
variables:
repo: bionic-test
publish:bionic-release:
<<: *publish_bionic
dependencies:
- build:bionic-release
variables:
repo: bionic-stable
when: manual
publish:centos7: &publish_centos
<<: *publish
dependencies:
- build:centos7
script:
- rpm --addsign rpm/RPMS/noarch/*.rpm rpm/SRPMS/*.rpm
- cp rpm/RPMS/noarch/*.rpm /home/debian/postgresql/yum/$repo/noarch
- cp rpm/SRPMS/*.rpm /home/debian/postgresql/yum/$repo/src
- cd /home/debian; make $repo
variables:
repo: el7-test
publish:centos7-release:
<<: *publish_centos
dependencies:
- build:centos7-release
variables:
repo: el7
when: manual
### deploy ###
# requires gitlab-runner to be configured to execute shell commands as root:
# rm /home/gitlab-runner/.bash_logout
# systemctl edit gitlab-runner
# [Service]
# ExecStart=
# ExecStart=/usr/bin/gitlab-runner "run" "--working-directory" "/home/gitlab-runner" "--config" "/etc/gitlab-runner/config.toml" "--service" --user root
deploy:stretch-x86: &deploy
stage: deploy
dependencies:
- publish:stretch
tags:
- stretch-amd64
script:
- 'test -f /etc/apt/sources.list.d/credativ_postgresql.list || echo "deb https://packages.credativ.com/public/postgresql/ $(lsb_release -cs)-test main" > https://packages.credativ.com/public/postgresql/'
- apt-get update -q
#- apt-get install -y ansible
- apt-get install -y 'elephant-shed.*'
only:
- master
- rel1_3
environment:
name: elephant-shed
url: https://elephant-shed.dev.credativ.de
deploy:buster-x86:
<<: *deploy
dependencies:
- publish:buster
tags:
- buster-amd64
environment:
name: elephant-shed-buster
url: https://elephant-shed-buster.dev.credativ.de
deploy:bionic-x86:
<<: *deploy
dependencies:
- publish:bionic
tags:
- bionic-amd64
environment:
name: elephant-shed-bionic
url: https://elephant-shed-bionic.dev.credativ.de
deploy:centos7-x86:
<<: *deploy
stage: deploy
dependencies:
- build:centos7
tags:
- centos7-x86
script:
- 'test -f /etc/yum.repos.d/pgdg-redhat-all.repo || yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm'
- 'test -f /etc/yum.repos.d/credativ-test.repo || yum install -y https://packages.credativ.com/public/postgresql/yum/credativ-test-repo.rpm'
- yum clean expire-cache
- yum update -y
- yum install -y elephant-shed
environment:
name: elephant-shed-centos7
url: https://elephant-shed-centos7.dev.credativ.de