-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
112 lines (90 loc) · 2.57 KB
/
.gitlab-ci.yml
File metadata and controls
112 lines (90 loc) · 2.57 KB
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
# SPDX-FileCopyrightText: Magenta ApS <https://magenta.dk>
# SPDX-License-Identifier: MPL-2.0
variables:
RELEASE_REGISTRY_IMAGE: index.docker.io/magentaaps/os2mint-omada
IMAGE_SHA: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}
PRECOMMIT_USE_POETRY: "true"
POETRY_VERSION: "1.3"
PYTEST_COV_MODULE: os2mint_omada
PYTEST_COV_FAIL_UNDER: 0
OS2MO_INIT_CONFIG: "/builds/$CI_PROJECT_PATH/init.config.yml"
stages:
- sync
- lint
- test
- coverage
- build
- release
- deploy
# Global Conditions
.if-default-branch-refs: &if-default-branch-refs
if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
.if-tag: &if-tag
if: '$CI_COMMIT_TAG'
.if-merge-request: &if-merge-request
if: '$CI_MERGE_REQUEST_IID'
workflow:
rules:
- <<: *if-tag
variables:
# Override the IMAGE_SHA variable on tag pipelines to avoid both the default
# branch pipeline and tag pipeline overriding each other's images arbitrarily when
# they are both running at the same time on master.
IMAGE_SHA: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}
- <<: *if-default-branch-refs
- <<: *if-merge-request
include:
- project: labs/salt-automation
file:
- gitlab-ci-templates/common/no-interrupt.v1.yml
- gitlab-ci-templates/common/conventional-commits.v1.yml
- gitlab-ci-templates/common/pre-commit.v1.yml
- gitlab-ci-templates/python/pytest.v1.yml
- gitlab-ci-templates/common/docker-build.v1.yml
- gitlab-ci-templates/common/docker-release.v1.yml
- gitlab-ci-templates/common/config-updater-meta.v1.yml
- project: rammearkitektur/os2mo
file:
- gitlab-ci-templates/integration-test-meta.v1.yml
# Test
Test:
variables:
PYTEST_ADDOPTS: "-m 'not integration_test'"
Integration-test:
extends:
- .integration-test:mo
variables:
OMADA__AMQP__URL: "amqp://guest:guest@msg-broker:5672/"
# Release
Deploy to Flux Dev:
extends: .release-to-dev
needs:
- Release version
variables:
ENDPOINT: os2mo/flux/omada/update-dev
Deploy to Flux Test:
extends: .release-to-test
needs: []
variables:
ENDPOINT: os2mo/flux/omada/update-test
Deploy to Flux Prod:
extends: .release-to-prod
needs: []
variables:
ENDPOINT: os2mo/flux/omada/update-prod
Deploy to Salt Dev:
extends: .release-to-dev
needs:
- Release version
variables:
ENDPOINT: os2mo/salt/omada/update-dev
Deploy to Salt Test:
extends: .release-to-test
needs: []
variables:
ENDPOINT: os2mo/salt/omada/update-test
Deploy to Salt Prod:
extends: .release-to-prod
needs: []
variables:
ENDPOINT: os2mo/salt/omada/update-prod