-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
88 lines (77 loc) · 2.34 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
# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-FileCopyrightText: 2024 Univention GmbH
---
include:
- project: "univention/customers/dataport/upx/common-ci"
ref: "v1.33.1"
file:
- "defaults/stages.yaml"
- "defaults/nubus-workflow.yaml"
- "jobs/lint-pre-commit.yaml"
- "jobs/lint-commit-messages.yaml"
- "jobs/semantic-release-env.yaml"
- "jobs/container-build.yaml"
- "jobs/container-build-external.yaml"
- "jobs/package-and-publish-helm-charts-external.yaml"
lint-pre-commit:
before_script:
- helm repo add bitnami https://charts.bitnami.com/bitnami
variables:
TEST_PORTAL_BASE_URL:
description: "The base URL of the portal to test. Example: https://portal.uv-username.gaia.open-desk.cloud/univention/portal/"
.build-matrix: &build-matrix
- IMAGE_NAME: "e2e-tests-runner"
KANIKO_BUILD_CONTEXT: $CI_PROJECT_DIR
DOCKERFILE_PATH: "Dockerfile"
- IMAGE_NAME: "testing-api"
KANIKO_BUILD_CONTEXT: $CI_PROJECT_DIR
DOCKERFILE_PATH: "docker/testing-api/Dockerfile"
.publish-matrix: &publish-matrix
- IMAGE_NAME:
- "testing-api"
container-build:
parallel:
matrix: *build-matrix
push-image-external:
parallel:
matrix: *publish-matrix
container-sign-external:
parallel:
matrix: *publish-matrix
container-malware-scan:
parallel:
matrix: *publish-matrix
test-container:
stage: "test"
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: "never"
- when: "on_success"
image: "${CI_REGISTRY_IMAGE}/e2e-tests-runner:${RELEASE_VERSION}"
script:
- rm -r tests-ldap/
- pytest --fixtures
e2e-tests:
stage: "test"
image: "$CI_REGISTRY_IMAGE/e2e-tests-runner:${RELEASE_VERSION}"
artifacts:
expose_as: "report"
paths:
- "${CI_PROJECT_DIR}/report.html"
- "${CI_PROJECT_DIR}/test-results/"
when: "always"
reports:
junit: "test_results.xml"
expire_in: "14 days"
variables:
PORTAL_BASE_URL: "${TEST_PORTAL_BASE_URL}"
script: |
./entrypoint.sh pytest --showlocals --junitxml=test_results.xml --html=report.html --self-contained-html --capture=no --verbose
tags:
- "docker"
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "api"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "pipeline"'
- if: '$CI_PIPELINE_SOURCE == "trigger"'