Skip to content

Commit

Permalink
Final updates after 20241128
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Dec 3, 2024
1 parent 791a69d commit fcb18dc
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 49 deletions.
15 changes: 13 additions & 2 deletions 160_gitlab_ci/110_triggers/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,18 @@ trigger-job:

---

## Pro tip 4: Permissions for include
## Pro tip 4: Types of variables to forward

Use `trigger:forward` [](https://docs.gitlab.com/ee/ci/yaml/#triggerforward) to define which types of variables to forward to downstream pipelines

- `yaml_variables` - variables defined in the trigger job
- `pipeline_variables` - variables passed to this pipeline [](https://docs.gitlab.com/ee/ci/variables/index.html#cicd-variable-precedence)

This only works for the direct downstream pipeline

---

## Pro tip 5: Permissions for include

When including a file from another project...

Expand All @@ -253,7 +264,7 @@ job_name:

---

## Pro tip 5: Dynamic includes
## Pro tip 6: Dynamic includes

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

Expand Down
12 changes: 1 addition & 11 deletions 160_gitlab_ci/120_templates/exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,7 @@ Move the template into a separate file `go.yaml` and use the [`include`](https:/
Afterwards check the pipeline in the GitLab UI. You should see a successful pipeline run.

??? info "Hint (Click if you are stuck)"
`go.yaml`:

```yaml
.build-go:
script:
- |
go build \
-ldflags "-X main.Version=${CI_COMMIT_REF_NAME} -X 'main.Author=${AUTHOR}'" \
-o hello \
.
```
Create the file `go.yaml` and move the template there. Use the `include` keyword to import the template.

??? example "Solution (Click if you are stuck)"
`go.yaml`:
Expand Down
15 changes: 14 additions & 1 deletion 160_gitlab_ci/130_rules/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ Adjust order from most specific...
Use GitLab Pages to create a download page [](https://docs.gitlab.com/ee/user/project/pages/)
- The job must be called `pages` [](https://docs.gitlab.com/ee/ci/yaml/#pages)
- The must create an artifact from the directory called `public`

See chapter [Rules](/hands-on/2024-11-21/130_rules/exercise/)

---
Expand Down Expand Up @@ -157,7 +160,17 @@ job_name:

---

# Pro tip 5: GitLab Pages access control
# Pro tip 5: Tweaking GitLab Pages

The content directory can be configured using `pages:publish` [](https://docs.gitlab.com/ee/ci/yaml/#pagespublish)

Premium/Ultimate: Deploy to a sub-directory `pages:pages.path_prefix` [](https://docs.gitlab.com/ee/ci/yaml/#pagespagespath_prefix)

Premium/Ultimate: Expire a pages deployment `pages:pages.expire_in` [](https://docs.gitlab.com/ee/ci/yaml/#pagespagesexpire_in)

---

# Pro tip 6: GitLab Pages access control

GitLab Pages are public by default

Expand Down
2 changes: 0 additions & 2 deletions 160_gitlab_ci/140_merge_requests/exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
Expand Down Expand Up @@ -182,7 +181,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
Expand Down
2 changes: 0 additions & 2 deletions 160_gitlab_ci/150_matrix_jobs/exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
Expand Down Expand Up @@ -237,7 +236,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
Expand Down
2 changes: 0 additions & 2 deletions 160_gitlab_ci/220_services/exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
Expand Down Expand Up @@ -174,7 +173,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
Expand Down
4 changes: 2 additions & 2 deletions 160_gitlab_ci/230_docker/exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
Expand Down Expand Up @@ -175,7 +174,8 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe

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

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

<!-- TODO: use !reference -->
<!-- TODO: multi-arch build -->
<!-- TODO: rootless Docker -->
1 change: 0 additions & 1 deletion 160_gitlab_ci/240_registries/exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
Expand Down
1 change: 0 additions & 1 deletion 160_gitlab_ci/250_releases/exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
Expand Down
1 change: 0 additions & 1 deletion 160_gitlab_ci/270_renovate/exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
Expand Down
1 change: 0 additions & 1 deletion 160_gitlab_ci/280_security/exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
Expand Down
10 changes: 10 additions & 0 deletions 160_gitlab_ci/agenda.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## Questions

### Do you have any experience with CI/CD?

### Are you using GitLab?

### Are you using GitLab CI?

---

## Agenda

| From | To | What |
Expand Down
6 changes: 4 additions & 2 deletions 2024-11-21_heise-GitLab-CI.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ <h2>Agenda</h2>
<section data-markdown="160_gitlab_ci/140_merge_requests/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/150_matrix_jobs/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/160_variable_precedence/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/200_job_token/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/205_git_submodules/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/200_permissions/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/210_job_token/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/215_git_submodules/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/220_services/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/230_docker/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/240_registries/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/250_releases/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/252_branch_protection/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/255_troubleshooting/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/260_runners/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
<section data-markdown="160_gitlab_ci/265_caches/slides.md" data-separator="^---$" data-separator-vertical="^--$"></section>
Expand Down
21 changes: 0 additions & 21 deletions 2024-11-21_heise-GitLab-CI.md

This file was deleted.

0 comments on commit fcb18dc

Please sign in to comment.