File tree 14 files changed +44
-49
lines changed
14 files changed +44
-49
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,18 @@ trigger-job:
236
236
237
237
---
238
238
239
- # # Pro tip 4: Permissions for include
239
+ # # Pro tip 4: Types of variables to forward
240
+
241
+ Use `trigger:forward` [](https://docs.gitlab.com/ee/ci/yaml/#triggerforward) to define which types of variables to forward to downstream pipelines
242
+
243
+ - ` yaml_variables` - variables defined in the trigger job
244
+ - ` pipeline_variables` - variables passed to this pipeline [](https://docs.gitlab.com/ee/ci/variables/index.html#cicd-variable-precedence)
245
+
246
+ This only works for the direct downstream pipeline
247
+
248
+ ---
249
+
250
+ # # Pro tip 5: Permissions for include
240
251
241
252
When including a file from another project...
242
253
@@ -253,7 +264,7 @@ job_name:
253
264
254
265
---
255
266
256
- # # Pro tip 5 : Dynamic includes
267
+ # # Pro tip 6 : Dynamic includes
257
268
258
269
Included file can also be generated before job start [](https://docs.gitlab.com/ee/ci/pipelines/downstream_pipelines.html#dynamic-child-pipelines)
259
270
Original file line number Diff line number Diff line change @@ -117,17 +117,7 @@ Move the template into a separate file `go.yaml` and use the [`include`](https:/
117
117
Afterwards check the pipeline in the GitLab UI. You should see a successful pipeline run.
118
118
119
119
??? info "Hint (Click if you are stuck)"
120
- ` go.yaml ` :
121
-
122
- ```yaml
123
- .build-go:
124
- script:
125
- - |
126
- go build \
127
- -ldflags "-X main.Version=${CI_COMMIT_REF_NAME} -X 'main.Author=${AUTHOR}'" \
128
- -o hello \
129
- .
130
- ```
120
+ Create the file ` go.yaml ` and move the template there. Use the ` include ` keyword to import the template.
131
121
132
122
??? example "Solution (Click if you are stuck)"
133
123
` go.yaml ` :
Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ Adjust order from most specific...
79
79
80
80
Use GitLab Pages to create a download page [](https://docs.gitlab.com/ee/user/project/pages/)
81
81
82
+ - The job must be called ` pages` [](https://docs.gitlab.com/ee/ci/yaml/#pages)
83
+ - The must create an artifact from the directory called `public`
84
+
82
85
See chapter [Rules](/hands-on/2024-11-21/130_rules/exercise/)
83
86
84
87
---
@@ -157,7 +160,17 @@ job_name:
157
160
158
161
---
159
162
160
- # Pro tip 5: GitLab Pages access control
163
+ # Pro tip 5: Tweaking GitLab Pages
164
+
165
+ The content directory can be configured using `pages:publish` [](https://docs.gitlab.com/ee/ci/yaml/#pagespublish)
166
+
167
+ Premium/Ultimate : Deploy to a sub-directory `pages:pages.path_prefix` [](https://docs.gitlab.com/ee/ci/yaml/#pagespagespath_prefix)
168
+
169
+ Premium/Ultimate : Expire a pages deployment `pages:pages.expire_in` [](https://docs.gitlab.com/ee/ci/yaml/#pagespagesexpire_in)
170
+
171
+ ---
172
+
173
+ # Pro tip 6: GitLab Pages access control
161
174
162
175
GitLab Pages are public by default
163
176
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
33
33
- if: $CI_PIPELINE_SOURCE == 'push'
34
34
- if: $CI_PIPELINE_SOURCE == 'web'
35
35
- if: $CI_PIPELINE_SOURCE == 'schedule'
36
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
37
36
- if: $CI_PIPELINE_SOURCE == 'pipeline'
38
37
- if: $CI_PIPELINE_SOURCE == 'api'
39
38
when: never
@@ -182,7 +181,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
182
181
- if: $CI_PIPELINE_SOURCE == 'push'
183
182
- if: $CI_PIPELINE_SOURCE == 'web'
184
183
- if: $CI_PIPELINE_SOURCE == 'schedule'
185
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
186
184
- if: $CI_PIPELINE_SOURCE == 'pipeline'
187
185
- if: $CI_PIPELINE_SOURCE == 'api'
188
186
when: never
Original file line number Diff line number Diff line change @@ -58,7 +58,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
58
58
- if: $CI_PIPELINE_SOURCE == 'push'
59
59
- if: $CI_PIPELINE_SOURCE == 'web'
60
60
- if: $CI_PIPELINE_SOURCE == 'schedule'
61
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
62
61
- if: $CI_PIPELINE_SOURCE == 'pipeline'
63
62
- if: $CI_PIPELINE_SOURCE == 'api'
64
63
when: never
@@ -237,7 +236,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
237
236
- if: $CI_PIPELINE_SOURCE == 'push'
238
237
- if: $CI_PIPELINE_SOURCE == 'web'
239
238
- if: $CI_PIPELINE_SOURCE == 'schedule'
240
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
241
239
- if: $CI_PIPELINE_SOURCE == 'pipeline'
242
240
- if: $CI_PIPELINE_SOURCE == 'api'
243
241
when: never
Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
38
38
- if: $CI_PIPELINE_SOURCE == ' push'
39
39
- if: $CI_PIPELINE_SOURCE == ' web'
40
40
- if: $CI_PIPELINE_SOURCE == ' schedule'
41
- - if: $CI_PIPELINE_SOURCE == ' merge_request_event'
42
41
- if: $CI_PIPELINE_SOURCE == ' pipeline'
43
42
- if: $CI_PIPELINE_SOURCE == ' api'
44
43
when: never
@@ -174,7 +173,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
174
173
- if: $CI_PIPELINE_SOURCE == ' push'
175
174
- if: $CI_PIPELINE_SOURCE == ' web'
176
175
- if: $CI_PIPELINE_SOURCE == ' schedule'
177
- - if: $CI_PIPELINE_SOURCE == ' merge_request_event'
178
176
- if: $CI_PIPELINE_SOURCE == ' pipeline'
179
177
- if: $CI_PIPELINE_SOURCE == ' api'
180
178
when: never
Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
51
51
- if: $CI_PIPELINE_SOURCE == 'push'
52
52
- if: $CI_PIPELINE_SOURCE == 'web'
53
53
- if: $CI_PIPELINE_SOURCE == 'schedule'
54
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
55
54
- if: $CI_PIPELINE_SOURCE == 'pipeline'
56
55
- if: $CI_PIPELINE_SOURCE == 'api'
57
56
when: never
@@ -175,7 +174,8 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
175
174
176
175
## Bonus task: Create a template for building container images
177
176
178
- Similar to the template for building and testing Go, create a template for building container images including logging in to and out of a container registry.
177
+ Similar to the template for building and testing Go, create a template for building container images including logging in and out of a container registry.
179
178
179
+ <!-- TODO: use !reference -->
180
180
<!-- TODO: multi-arch build -->
181
181
<!-- TODO: rootless Docker -->
Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
38
38
- if: $CI_PIPELINE_SOURCE == 'push'
39
39
- if: $CI_PIPELINE_SOURCE == 'web'
40
40
- if: $CI_PIPELINE_SOURCE == 'schedule'
41
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
42
41
- if: $CI_PIPELINE_SOURCE == 'pipeline'
43
42
- if: $CI_PIPELINE_SOURCE == 'api'
44
43
when: never
Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
46
46
- if: $CI_PIPELINE_SOURCE == 'push'
47
47
- if: $CI_PIPELINE_SOURCE == 'web'
48
48
- if: $CI_PIPELINE_SOURCE == 'schedule'
49
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
50
49
- if: $CI_PIPELINE_SOURCE == 'pipeline'
51
50
- if: $CI_PIPELINE_SOURCE == 'api'
52
51
when: never
Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
40
40
- if: $CI_PIPELINE_SOURCE == ' push'
41
41
- if: $CI_PIPELINE_SOURCE == ' web'
42
42
- if: $CI_PIPELINE_SOURCE == ' schedule'
43
- - if: $CI_PIPELINE_SOURCE == ' merge_request_event'
44
43
- if: $CI_PIPELINE_SOURCE == ' pipeline'
45
44
- if: $CI_PIPELINE_SOURCE == ' api'
46
45
when: never
Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
34
34
- if: $CI_PIPELINE_SOURCE == 'push'
35
35
- if: $CI_PIPELINE_SOURCE == 'web'
36
36
- if: $CI_PIPELINE_SOURCE == 'schedule'
37
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
38
37
- if: $CI_PIPELINE_SOURCE == 'pipeline'
39
38
- if: $CI_PIPELINE_SOURCE == 'api'
40
39
when: never
Original file line number Diff line number Diff line change
1
+ ## Questions
2
+
3
+ ### Do you have any experience with CI/CD?
4
+
5
+ ### Are you using GitLab?
6
+
7
+ ### Are you using GitLab CI?
8
+
9
+ ---
10
+
1
11
## Agenda
2
12
3
13
| From | To | What |
Original file line number Diff line number Diff line change @@ -74,12 +74,14 @@ <h2>Agenda</h2>
74
74
< section data-markdown ="160_gitlab_ci/140_merge_requests/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
75
75
< section data-markdown ="160_gitlab_ci/150_matrix_jobs/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
76
76
< section data-markdown ="160_gitlab_ci/160_variable_precedence/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
77
- < section data-markdown ="160_gitlab_ci/200_job_token/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
78
- < section data-markdown ="160_gitlab_ci/205_git_submodules/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
77
+ < section data-markdown ="160_gitlab_ci/200_permissions/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
78
+ < section data-markdown ="160_gitlab_ci/210_job_token/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
79
+ < section data-markdown ="160_gitlab_ci/215_git_submodules/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
79
80
< section data-markdown ="160_gitlab_ci/220_services/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
80
81
< section data-markdown ="160_gitlab_ci/230_docker/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
81
82
< section data-markdown ="160_gitlab_ci/240_registries/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
82
83
< section data-markdown ="160_gitlab_ci/250_releases/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
84
+ < section data-markdown ="160_gitlab_ci/252_branch_protection/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
83
85
< section data-markdown ="160_gitlab_ci/255_troubleshooting/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
84
86
< section data-markdown ="160_gitlab_ci/260_runners/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
85
87
< section data-markdown ="160_gitlab_ci/265_caches/slides.md " data-separator ="^---$ " data-separator-vertical ="^--$ "> </ section >
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments