forked from oceanbase/seekdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
85 lines (78 loc) · 2.58 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
85 lines (78 loc) · 2.58 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
# =============================================================================
# .gitlab-ci.yml — OceanBase Lite (seekdb) CI Driver Entrypoint
#
# 三层架构第 1 层:纯路由 / 模板选择器。
# 仅负责按 FARM2_TEMPLATE_NAME 选择模板并触发对应子流水线;
# 业务模板位于 test/ci/templates/
# =============================================================================
variables:
FARM2_TEMPLATE_NAME: "farm_for_standalone"
TEMPLATE_ENTRY_FILE: "template_entry.yml"
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "trigger"
- if: $CI_PIPELINE_SOURCE == "api"
- when: never
.gitlab_ci_anchor_k8s_prepare_driver:
stage: prepare
script: [":"]
variables: &driver_k8s_resources
KUBERNETES_CPU_REQUEST: "1"
KUBERNETES_CPU_LIMIT: "2"
KUBERNETES_MEMORY_REQUEST: "1Gi"
KUBERNETES_MEMORY_LIMIT: "4Gi"
KUBERNETES_POD_ANNOTATIONS_1: "request_disk_size=300"
KUBERNETES_POD_ANNOTATIONS_2: "carina.storage.io/blkio.throttle.read_iops_device=5000"
KUBERNETES_POD_ANNOTATIONS_3: "carina.storage.io/blkio.throttle.write_iops_device=5000"
default:
tags:
- farm-use
stages:
- prepare
render_template_entry:
stage: prepare
image: harbor.oceanbase-dev.com/ob-task-platform/farm2-standard-worker:1.1.2
variables:
<<: *driver_k8s_resources
KUBERNETES_STORAGE_SIZE: "20Gi"
script:
- |
set -e
[[ "${FARM2_TEMPLATE_NAME:-}" =~ ^[A-Za-z0-9._-]+$ ]] || {
echo "[ERROR] invalid FARM2_TEMPLATE_NAME=${FARM2_TEMPLATE_NAME:-unset}" >&2
exit 1
}
_template_path="test/ci/templates/${FARM2_TEMPLATE_NAME}.yml"
[[ -f "${_template_path}" ]] || {
echo "[ERROR] template not found: ${_template_path}" >&2
exit 1
}
printf 'include:\n - local: %s\n' "${_template_path}" > "${TEMPLATE_ENTRY_FILE}"
echo "[driver] selected template=${FARM2_TEMPLATE_NAME} path=${_template_path}"
cat "${TEMPLATE_ENTRY_FILE}"
artifacts:
paths:
- template_entry.yml
expire_in: 10 days
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "trigger"
- if: $CI_PIPELINE_SOURCE == "api"
trigger_template_pipeline:
stage: prepare
needs:
- job: render_template_entry
artifacts: true
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "trigger"
- if: $CI_PIPELINE_SOURCE == "api"
trigger:
strategy: depend
forward:
yaml_variables: true
pipeline_variables: true
include:
- artifact: template_entry.yml
job: render_template_entry