Skip to content

Commit fcb18dc

Browse files
committed
Final updates after 20241128
1 parent 791a69d commit fcb18dc

File tree

14 files changed

+44
-49
lines changed

14 files changed

+44
-49
lines changed

160_gitlab_ci/110_triggers/slides.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,18 @@ trigger-job:
236236

237237
---
238238

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
240251

241252
When including a file from another project...
242253

@@ -253,7 +264,7 @@ job_name:
253264

254265
---
255266

256-
## Pro tip 5: Dynamic includes
267+
## Pro tip 6: Dynamic includes
257268

258269
Included file can also be generated before job start [](https://docs.gitlab.com/ee/ci/pipelines/downstream_pipelines.html#dynamic-child-pipelines)
259270

160_gitlab_ci/120_templates/exercise.md

+1-11
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,7 @@ Move the template into a separate file `go.yaml` and use the [`include`](https:/
117117
Afterwards check the pipeline in the GitLab UI. You should see a successful pipeline run.
118118

119119
??? 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.
131121

132122
??? example "Solution (Click if you are stuck)"
133123
`go.yaml`:

160_gitlab_ci/130_rules/slides.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ Adjust order from most specific...
7979
8080
Use GitLab Pages to create a download page [](https://docs.gitlab.com/ee/user/project/pages/)
8181
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+
8285
See chapter [Rules](/hands-on/2024-11-21/130_rules/exercise/)
8386

8487
---
@@ -157,7 +160,17 @@ job_name:
157160

158161
---
159162

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
161174

162175
GitLab Pages are public by default
163176

160_gitlab_ci/140_merge_requests/exercise.md

-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
3333
- if: $CI_PIPELINE_SOURCE == 'push'
3434
- if: $CI_PIPELINE_SOURCE == 'web'
3535
- if: $CI_PIPELINE_SOURCE == 'schedule'
36-
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
3736
- if: $CI_PIPELINE_SOURCE == 'pipeline'
3837
- if: $CI_PIPELINE_SOURCE == 'api'
3938
when: never
@@ -182,7 +181,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
182181
- if: $CI_PIPELINE_SOURCE == 'push'
183182
- if: $CI_PIPELINE_SOURCE == 'web'
184183
- if: $CI_PIPELINE_SOURCE == 'schedule'
185-
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
186184
- if: $CI_PIPELINE_SOURCE == 'pipeline'
187185
- if: $CI_PIPELINE_SOURCE == 'api'
188186
when: never

160_gitlab_ci/150_matrix_jobs/exercise.md

-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
5858
- if: $CI_PIPELINE_SOURCE == 'push'
5959
- if: $CI_PIPELINE_SOURCE == 'web'
6060
- if: $CI_PIPELINE_SOURCE == 'schedule'
61-
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
6261
- if: $CI_PIPELINE_SOURCE == 'pipeline'
6362
- if: $CI_PIPELINE_SOURCE == 'api'
6463
when: never
@@ -237,7 +236,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
237236
- if: $CI_PIPELINE_SOURCE == 'push'
238237
- if: $CI_PIPELINE_SOURCE == 'web'
239238
- if: $CI_PIPELINE_SOURCE == 'schedule'
240-
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
241239
- if: $CI_PIPELINE_SOURCE == 'pipeline'
242240
- if: $CI_PIPELINE_SOURCE == 'api'
243241
when: never

160_gitlab_ci/220_services/exercise.md

-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
3838
- if: $CI_PIPELINE_SOURCE == 'push'
3939
- if: $CI_PIPELINE_SOURCE == 'web'
4040
- if: $CI_PIPELINE_SOURCE == 'schedule'
41-
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
4241
- if: $CI_PIPELINE_SOURCE == 'pipeline'
4342
- if: $CI_PIPELINE_SOURCE == 'api'
4443
when: never
@@ -174,7 +173,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
174173
- if: $CI_PIPELINE_SOURCE == 'push'
175174
- if: $CI_PIPELINE_SOURCE == 'web'
176175
- if: $CI_PIPELINE_SOURCE == 'schedule'
177-
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
178176
- if: $CI_PIPELINE_SOURCE == 'pipeline'
179177
- if: $CI_PIPELINE_SOURCE == 'api'
180178
when: never

160_gitlab_ci/230_docker/exercise.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
5151
- if: $CI_PIPELINE_SOURCE == 'push'
5252
- if: $CI_PIPELINE_SOURCE == 'web'
5353
- if: $CI_PIPELINE_SOURCE == 'schedule'
54-
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
5554
- if: $CI_PIPELINE_SOURCE == 'pipeline'
5655
- if: $CI_PIPELINE_SOURCE == 'api'
5756
when: never
@@ -175,7 +174,8 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
175174

176175
## Bonus task: Create a template for building container images
177176

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.
179178

179+
<!-- TODO: use !reference -->
180180
<!-- TODO: multi-arch build -->
181181
<!-- TODO: rootless Docker -->

160_gitlab_ci/240_registries/exercise.md

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
3838
- if: $CI_PIPELINE_SOURCE == 'push'
3939
- if: $CI_PIPELINE_SOURCE == 'web'
4040
- if: $CI_PIPELINE_SOURCE == 'schedule'
41-
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
4241
- if: $CI_PIPELINE_SOURCE == 'pipeline'
4342
- if: $CI_PIPELINE_SOURCE == 'api'
4443
when: never

160_gitlab_ci/250_releases/exercise.md

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
4646
- if: $CI_PIPELINE_SOURCE == 'push'
4747
- if: $CI_PIPELINE_SOURCE == 'web'
4848
- if: $CI_PIPELINE_SOURCE == 'schedule'
49-
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
5049
- if: $CI_PIPELINE_SOURCE == 'pipeline'
5150
- if: $CI_PIPELINE_SOURCE == 'api'
5251
when: never

160_gitlab_ci/270_renovate/exercise.md

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
4040
- if: $CI_PIPELINE_SOURCE == 'push'
4141
- if: $CI_PIPELINE_SOURCE == 'web'
4242
- if: $CI_PIPELINE_SOURCE == 'schedule'
43-
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
4443
- if: $CI_PIPELINE_SOURCE == 'pipeline'
4544
- if: $CI_PIPELINE_SOURCE == 'api'
4645
when: never

160_gitlab_ci/280_security/exercise.md

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
3434
- if: $CI_PIPELINE_SOURCE == 'push'
3535
- if: $CI_PIPELINE_SOURCE == 'web'
3636
- if: $CI_PIPELINE_SOURCE == 'schedule'
37-
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
3837
- if: $CI_PIPELINE_SOURCE == 'pipeline'
3938
- if: $CI_PIPELINE_SOURCE == 'api'
4039
when: never

160_gitlab_ci/agenda.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
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+
111
## Agenda
212

313
| From | To | What |

2024-11-21_heise-GitLab-CI.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ <h2>Agenda</h2>
7474
<section data-markdown="160_gitlab_ci/140_merge_requests/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
7575
<section data-markdown="160_gitlab_ci/150_matrix_jobs/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
7676
<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>
7980
<section data-markdown="160_gitlab_ci/220_services/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
8081
<section data-markdown="160_gitlab_ci/230_docker/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
8182
<section data-markdown="160_gitlab_ci/240_registries/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
8283
<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>
8385
<section data-markdown="160_gitlab_ci/255_troubleshooting/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
8486
<section data-markdown="160_gitlab_ci/260_runners/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
8587
<section data-markdown="160_gitlab_ci/265_caches/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>

2024-11-21_heise-GitLab-CI.md

-21
This file was deleted.

0 commit comments

Comments
 (0)