forked from 3liz/qgis-lizmap-server-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
223 lines (203 loc) · 4.36 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
variables:
FACTORY_PRODUCT_NAME: lizmap_server
FACTORY_PACKAGE_TYPE: plugin
stages:
- test
- build
- package-infra
- qgis-plugin
- qgis-repository-edit
- qgis-repository-push
- deploy
- release
.tests:
image: ${REGISTRY_URL}/factory-ci-runner:qgis-${QGIS_FLAVOR}
stage: test
script:
- source ~/.bashrc
- make install-tests FLAVOR=$QGIS_FLAVOR
- pip list -l
- make test FLAVOR=$QGIS_FLAVOR
tags:
- factory
qgis-server:
extends: .tests
parallel:
matrix:
- QGIS_FLAVOR: [
"3.28",
"3.34",
"nightly-release",
]
qgis-server-legacy:
stage: test
parallel:
matrix:
- QGIS_VERSION: [
"3.16",
"3.22",
]
script:
- make tests FLAVOR=${QGIS_VERSION}
tags:
- infrav3
linter:
image: ${REGISTRY_URL}/factory-ci-runner:qgis-ltr
stage: test
script:
- source ~/.bashrc
- make install-tests lint FLAVOR=$QGIS_FLAVOR
tags:
- factory
version:
stage: test
only:
- tags
- master
image:
name: $REGISTRY_URI/infra/ci-tools:latest
script:
- version-helper
tags:
- factory-plain
artifacts:
reports:
dotenv: build.env
package-zip:
only:
- tags
- master
dependencies:
- version
stage: build
image: $REGISTRY_URI/qgis-plugin-ci:latest
script:
- >
qgis-plugin-ci
package ${VERSION}
--plugin-repo-url https://packages.3liz.org/pub/${FACTORY_PRODUCT_NAME}-qgis-plugin/${STATUS}/
# For infraV2 infraV3
# On a tag, the zip will be the existing already
- cp ${FACTORY_PRODUCT_NAME}.${VERSION}.zip lizmap_server.${CI_COMMIT_REF_NAME}.zip || true
tags:
- infrav3-plain
artifacts:
untracked: true
expose_as: 'QGIS package'
paths:
# For infraV2 infraV3
- ${FACTORY_PRODUCT_NAME}.${CI_COMMIT_REF_NAME}.zip
- ${FACTORY_PRODUCT_NAME}.${VERSION}.zip
- plugins.xml
push-zip-fetch-repo:
only:
- tags
- master
dependencies:
- version
- package-zip
stage: qgis-plugin
script:
# Upload into the plugin directory
- upload_to_packages_server ${FACTORY_PRODUCT_NAME}.${VERSION}.zip pub/${FACTORY_PRODUCT_NAME}-qgis-plugin/${STATUS}/
- upload_to_packages_server plugins.xml pub/${FACTORY_PRODUCT_NAME}-qgis-plugin/${STATUS}/
# Fetch XML files
- mkdir tmp_repository
- pull_folder_from_packages_server pub/server-plugins-repository/${STATUS}/ tmp_repository
# This CI job is running as "fabric" user, the next job is "factory"
- chmod 777 -R tmp_repository/
tags:
- fabric
artifacts:
paths:
- tmp_repository/*.xml
edit-repository:
only:
- tags
- master
stage: qgis-repository-edit
dependencies:
- package-zip
- push-zip-fetch-repo
before_script:
- PATH=$PATH:~/.local/bin
- pip3 install --user qgis-plugin-repo
script:
- qgis-plugin-repo merge plugins.xml tmp_repository/*.xml
tags:
- factory
artifacts:
untracked: true
paths:
- tmp_repository/*.xml
push-repository:
only:
- tags
- master
stage: qgis-repository-push
dependencies:
- version
- edit-repository
script:
- upload_folder_to_packages_server tmp_repository/ pub/server-plugins-repository/${STATUS}/
tags:
- fabric
# Dev for infra-V2 and infra-V3
# For snap, artifact available : lizmap_server.master.zip
# For prod, artifact available : lizmap_server.${CI_COMMIT_REF_NAME}.zip
.infrav3-package:
only:
- tags
- master
dependencies:
- version
- package-zip
script:
- $FACTORY_SCRIPTS/make-package-$CI_STAGING qgis_lizmap_server ${VERSION} ${FACTORY_PRODUCT_NAME} qgis-plugin
tags:
- infrav3
variables:
CI_ARCHIVE: ${FACTORY_PRODUCT_NAME}.${VERSION}.zip
deploy_snap:infrav3:
only:
- tags
- master
extends: .infrav3-package
stage: deploy
environment:
name: snap
variables:
CI_STAGING: snapshot
release_prod:infrav3:
extends: .infrav3-package
stage: release
environment:
name: production
only:
- tags
variables:
CI_STAGING: release
deploy:infrav2:
stage: deploy
dependencies:
- push-repository
script:
- update-snap-qgis-plugins
environment:
name: snap
only:
refs:
- tags
- master
tags:
- fabric
tickets:
stage: release
only:
- tags
image:
name: $REGISTRY_URI/infra/ci-tools:latest
script:
- create_ticket.py
tags:
- factory-plain