-
Notifications
You must be signed in to change notification settings - Fork 210
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
156 lines (138 loc) · 3.57 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
156 lines (138 loc) · 3.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
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
153
154
155
156
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c) 2025, Timo Pallach (timo@pallach.de).
# Example GitLab CI configuration demonstrating scheduled pipeline testing
# This file shows how to use conditional includes and complex rules
stages:
- prepare
- build
- test
- deploy
# Example jobs that demonstrate different pipeline behaviors
standard-job:
stage: test
script:
- echo "This job runs in standard pipelines (push, merge_request_event)"
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
when: always
- when: never
scheduled-job:
stage: test
script:
- echo "This job runs in scheduled pipelines"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: always
- when: never
schedule-specific-job:
stage: test
script:
- echo "This job runs only for specific schedules"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_NAME == "Daily Check"
when: always
- when: never
always-job:
stage: test
script:
- echo "This job always runs regardless of pipeline source"
rules:
- when: always
# Example jobs for different pipeline sources
web-triggered-job:
stage: test
script:
- echo "This job runs when triggered via web interface"
rules:
- if: $CI_PIPELINE_SOURCE == "web"
when: always
- when: never
api-triggered-job:
stage: test
script:
- echo "This job runs when triggered via API"
rules:
- if: $CI_PIPELINE_SOURCE == "api"
when: always
- when: never
external-job:
stage: test
script:
- echo "This job runs when triggered via external CI services"
rules:
- if: $CI_PIPELINE_SOURCE == "external"
when: always
- when: never
merge-request-job:
stage: test
script:
- echo "This job runs when triggered via merge request"
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: always
- when: never
trigger-job:
stage: build
script:
- echo "This job runs when triggered via downstream pipeline"
rules:
- if: $CI_PIPELINE_SOURCE == "trigger"
when: always
- when: never
pipeline-job:
stage: deploy
script:
- echo "This job runs when triggered via multi-project pipeline"
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: always
- when: never
# Additional pipeline source examples
external-pull-request-job:
stage: test
script:
- echo "This job runs when triggered via external pull request on GitHub"
rules:
- if: $CI_PIPELINE_SOURCE == "external_pull_request_event"
when: always
- when: never
ondemand-dast-scan-job:
stage: test
script:
- echo "This job runs when triggered via DAST on-demand scan"
rules:
- if: $CI_PIPELINE_SOURCE == "ondemand_dast_scan"
when: always
- when: never
ondemand-dast-validation-job:
stage: test
script:
- echo "This job runs when triggered via DAST on-demand validation"
rules:
- if: $CI_PIPELINE_SOURCE == "ondemand_dast_validation"
when: always
- when: never
parent-pipeline-job:
stage: build
script:
- echo "This job runs when triggered via parent pipeline"
rules:
- if: $CI_PIPELINE_SOURCE == "parent_pipeline"
when: always
- when: never
security-orchestration-job:
stage: deploy
script:
- echo "This job runs when triggered via security orchestration policy"
rules:
- if: $CI_PIPELINE_SOURCE == "security_orchestration_policy"
when: always
- when: never
webide-job:
stage: test
script:
- echo "This job runs when triggered via Web IDE"
rules:
- if: $CI_PIPELINE_SOURCE == "webide"
when: always
- when: never