-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
.gitlab-ci.yml
118 lines (108 loc) · 2.53 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
stages:
- tests
- build
- qgis-plugin
- qgis-repository-edit
- qgis-repository-push
- deploy
- release
variables:
FACTORY_PRODUCT_NAME: cadastre
FACTORY_PACKAGE_TYPE: plugin
version:
stage: tests
image:
name: $REGISTRY_URI/infra/ci-tools:latest
script:
- version-helper
tags:
- factory-plain
artifacts:
reports:
dotenv: build.env
package-zip:
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}/
tags:
- factory-plain
artifacts:
untracked: true
expose_as: 'QGIS package'
paths:
- ${FACTORY_PRODUCT_NAME}.${VERSION}.zip
- plugins.xml
push-zip-fetch-repo:
image: ${REGISTRY_URL}/factory-ci-runner:fabric-ci
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:
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-dind
artifacts:
untracked: true
paths:
- tmp_repository/*.xml
push-repository:
image: ${REGISTRY_URL}/factory-ci-runner:fabric-ci
stage: qgis-repository-push
dependencies:
- version
- edit-repository
script:
- upload_folder_to_packages_server tmp_repository/ pub/server-plugins-repository/${STATUS}/
tags:
- fabric
deploy_snap_2:
image: ${REGISTRY_URL}/factory-ci-runner:fabric-ci
stage: deploy
dependencies:
- push-repository
script:
- update-snap-qgis-plugins
environment:
name: snap
tags:
- fabric
tickets:
stage: release
when: manual
only:
- tags
image:
name: $REGISTRY_URI/infra/ci-tools:latest
script:
- create_ticket.py
tags:
- factory-plain