forked from linagora/Gitlab_Monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
152 lines (123 loc) · 3.42 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
# # --- Copyright (c) 2024 Linagora
# # licence : GPL v3
# # - Flavien Perez [email protected]
# # - Maïlys Jara [email protected]
include:
- local: '/gitlab-ci_templates/build-dev.yml'
- local: '/gitlab-ci_templates/build-doc.yml'
- local: '/gitlab-ci_templates/build-prod.yml'
- local: '/gitlab-ci_templates/linter.yml'
- local: '/gitlab-ci_templates/packages.yml'
- local: '/gitlab-ci_templates/release.yml'
- local: '/gitlab-ci_templates/security.yml'
- local: '/gitlab-ci_templates/tests.yml'
variables:
PROJECT_PATH: ./gitlab_monitor
PROJECT_NAME: "gitlab-monitor"
HARBOR_REGISTRY: "docker-registry.linagora.com"
IMAGE_CACHE: "gitlab-monitor-dev"
DOCKER_TLS_CERTDIR: "/certs"
CACHE_TAG: "1.0.0-dev"
CODE_SOURCE: "./gitlab_monitor/"
IMAGE_CACHE_DEPLOY: "gitlab-monitor-deploy-cache"
default:
tags:
- stage
image: $HARBOR_REGISTRY/$PROJECT_NAME/$IMAGE_CACHE:$CACHE_TAG
stages:
- build
- test
- package-build
- publish
- production
- release
# ##################################################################
# # BUILD STAGE: BUILD & TESTS #
# ##################################################################
build-dev-env:
stage: build
extends: .build_dev_env
build-documentation:
stage: build
extends: .build_documentation
needs: []
build-prod-env:
stage: build
extends: .build_prod_env
needs: []
unit_tests:
stage: build
extends: .py-pytest
# ##################################################################
# # TEST STAGE: CODE QUALITY & SECURITY #
# ##################################################################
py-lint:
stage: test
extends: .py-lint
needs: []
py-black:
stage: test
extends: .py-black
needs: []
py-isort:
stage: test
extends: .py-isort
needs: []
pycln:
stage: test
extends: .pycln
needs: []
mypy:
stage: test
extends: .mypy
needs: []
py-bandit:
stage: test
extends: .py-bandit
needs: []
py-trivy:
stage: test
extends: .py-trivy
needs: []
slsa-1:
stage: test
extends: .slsa-1
needs: [build-prod-env]
# ##################################################################
# # BUILD PACKAGES STAGE #
# ##################################################################
build-package:
stage: package-build
extends: .build-package
needs: []
# ##################################################################
# # PUBLISH PACKAGES STAGE #
# ##################################################################
publish-package:
stage: publish
extends: .publish-package
needs: [build-package]
when: manual
# ##################################################################
# # RELEASE STAGE (CHANGELOGS) #
# ##################################################################
prepare:
stage: release
extends: .prepare_job
needs: []
release:
stage: release
extends: .release_job
needs:
- job: prepare
artifacts: true
# ##################################################################
# # PRODUCTION STAGE -> DEPLOY #
# ##################################################################
trigger_multiproject:
stage: production
trigger:
project: linagora/devops/gitlab-manager/gitlab-monitor-deploy
branch: k8s-deploy
strategy: depend
needs: [build-prod-env]