-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
130 lines (117 loc) · 3.93 KB
/
.gitlab-ci.yml
File metadata and controls
130 lines (117 loc) · 3.93 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# SPDX-FileCopyrightText: Magenta ApS <https://magenta.dk>
# SPDX-License-Identifier: MPL-2.0
stages:
- sync
- lint
- build
- test
- coverage
- release
- deploy
- docs
variables:
RELEASE_REGISTRY_IMAGE: index.docker.io/magentaaps/os2mo-ldap-import-export
IMAGE_SHA: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}
PRODUCT: os2mo
COMPONENT: ldapimportexport
PYTEST_COV_MODULE: mo_ldap_import_export
PYTEST_COV_FAIL_UNDER: 100
POETRY_VERSION: "1.8"
PRECOMMIT_USE_POETRY: "true"
OS2MO_INIT_CONFIG: "/builds/$CI_PROJECT_PATH/init.config.yaml"
# Conditions
#############
# 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"
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/conventional-commits-changelog.v1.yml
- gitlab-ci-templates/common/docker-build.v1.yml
- gitlab-ci-templates/common/docker-release.v1.yml
- gitlab-ci-templates/common/config-updater-salt.v1.yml
- project: labs/salt-automation
file:
- gitlab-ci-templates/common/pre-commit.v1.yml
rules:
- <<: *if-merge-request
- project: labs/salt-automation
file:
- gitlab-ci-templates/python/pytest.v1.yml
inputs:
pytest_addopts: "-m 'not integration_test'"
rules:
- <<: *if-merge-request
- project: rammearkitektur/os2mo
file:
- gitlab-ci-templates/integration-test-meta.v1.yml
# Workflow
###########
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
Integration-test:
extends:
- .integration-test:mo
services:
- !reference [.integration-test:mo, services]
# NOTE: These services should be kept synchronised with docker-compose.yml
- name: smblds/smblds:latest
alias: samba
# GitLab CI does not support `hostname:` on services, but Samba AD DC
# uses the container hostname during domain provisioning. Without a
# stable hostname, Samba provisions with a random container ID which
# can cause DirSync and other AD operations to hang.
# We override the entrypoint to inject `--host-name=dc` into the
# `samba-tool domain provision` command, since containers cannot call
# `sethostname(2)` without CAP_SYS_ADMIN.
entrypoint:
[
"sh",
"-c",
"sed -i 's/--adminpass/--host-name=dc --adminpass/' /entrypoint.sh && exec /entrypoint.sh",
]
variables:
DOMAIN: "MAGENTA"
REALM: "MAGENTA.DK"
ADMINPASS: "AdminPassword123"
INSECURE_LDAP: "true"
INSECURE_PASSWORDSETTINGS: "true"
- name: osixia/openldap:1.5.0
alias: ldap
command: ["--copy-service", "--loglevel", "debug"]
variables:
LDAP_ORGANISATION: "magenta"
LDAP_DOMAIN: "magenta.dk"
LDAP_ADMIN_PASSWORD: "AdminPassword123"
LDAP_CONFIG_PASSWORD: "ConfigPassword123"
LDAP_LOG_LEVEL: 512
# Use non-standard port to avoid conflict with Samba AD DC on 389
LDAP_PORT: 2389
LDAPS_PORT: 2636
parallel: 8
variables:
FASTRAMQPI__JSON_LOGS: False
# LDAP: Connection (OpenLDAP on non-standard port)
LDAP_CONTROLLERS: '[{"host": "ldap", "port": 2389}]'
LDAP_DOMAIN: "magenta.dk"
LDAP_USER: "cn=admin,dc=magenta,dc=dk"
LDAP_PASSWORD: "AdminPassword123"
LDAP_AUTH_METHOD: "simple"
LDAP_DIALECT: "Standard"
rules:
- <<: *if-merge-request