forked from 3liz/QgisCadastrePlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
147 lines (131 loc) · 2.92 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
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:
- infrav3-plain
artifacts:
untracked: true
expose_as: 'QGIS package'
paths:
- ${FACTORY_PRODUCT_NAME}.${VERSION}.zip
- plugins.xml
push-zip-fetch-repo:
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
artifacts:
untracked: true
paths:
- tmp_repository/*.xml
push-repository:
stage: qgis-repository-push
dependencies:
- version
- edit-repository
script:
- upload_folder_to_packages_server tmp_repository/ pub/server-plugins-repository/${STATUS}/
tags:
- fabric
.infrav3-package:
dependencies:
- version
- package-zip
script:
- $FACTORY_SCRIPTS/make-package-$CI_STAGING qgis_cadastre ${VERSION} ${FACTORY_PRODUCT_NAME} qgis-plugin
tags:
- infrav3
variables:
CI_ARCHIVE: ${FACTORY_PRODUCT_NAME}.${VERSION}.zip
deploy_snap_3:
extends: .infrav3-package
stage: deploy
environment:
name: snap
variables:
CI_STAGING: snapshot
release_prod_3:
extends: .infrav3-package
stage: release
environment:
name: production
only:
- tags
variables:
CI_STAGING: release
deploy_snap_2:
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