Skip to content

Commit

Permalink
Improved slides
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Nov 30, 2023
1 parent 934aaa0 commit 587011e
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 30 deletions.
6 changes: 5 additions & 1 deletion slides/2023-11-30/160_gitlab_ci/040_image/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@

## Image

Choose which container image [](https://docs.gitlab.com/ee/ci/yaml/#image) is used for your job
Without `image` you rely on the default container image

Our runner configuration defaults to `alpine` [<i class="fa-brands fa-docker"></i>](https://hub.docker.com/_/alpine) [<i class="fa-duotone fa-globe fa-duotone-colors"></i>](https://alpinelinux.org/)

Choose which container `image` [](https://docs.gitlab.com/ee/ci/yaml/#image) is used for your jobs

Each job can have its own container image

Use official images [<i class="fa-brands fa-docker"></i>](https://hub.docker.com/search?q=&image_filter=official)

Do not use community images
Expand Down
10 changes: 10 additions & 0 deletions slides/2023-11-30/160_gitlab_ci/050_defaults/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ Apply settings to all jobs using `default` [](https://docs.gitlab.com/ee/ci/yaml
- `after_script`
- and some more we will explore later <i class="fa-duotone fa-face-smile-halo fa-duotone-colors"></i>

### Example

```yaml
default:
image: alpine
before_script: echo "Welcome to this job"
job_name:
#...
```

### Hands-On

See chapter [Variables](/hands-on/20231130/050_defaults/exercise/)
12 changes: 6 additions & 6 deletions slides/2023-11-30/160_gitlab_ci/060_artifacts/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ Add untracked files

---

## Hands-On

See chapter [Artifacts](/hands-on/20231130/060_artifacts/exercise/)

---

## Dependencies

Jobs can restrict which job artifacts to receive
Expand Down Expand Up @@ -85,3 +79,9 @@ job_name2:
```
`dependencies` as well as `needs` limit from which jobs they are consumed

---

## Hands-On

See chapter [Artifacts](/hands-on/20231130/060_artifacts/exercise/)
6 changes: 3 additions & 3 deletions slides/2023-11-30/160_gitlab_ci/090_unit_tests/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

## Unit Tests

GitLab is able to consume JUnit formatted reports [](https://docs.gitlab.com/ee/ci/testing/unit_test_reports.html)
GitLab is able to consume JUnit XML formatted reports [](https://docs.gitlab.com/ee/ci/testing/unit_test_reports.html)

Reports must be prepared and defined as a special type of artifact
Reports must be defined as a special type of artifact

Reports will be displayed in the summary view of a pipeline

The following example is based on [this one](https://docs.gitlab.com/ee/ci/testing/unit_test_report_examples.html#go):
The following example was taken from the [official one](https://docs.gitlab.com/ee/ci/testing/unit_test_report_examples.html#go):

```yaml
golang:
Expand Down
10 changes: 4 additions & 6 deletions slides/2023-11-30/160_gitlab_ci/100_environments/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ CI variables can be scoped to environments

Environments are auto-created by the first job using them

### Our environments

Your demo environment has hidden services

![](160_gitlab_ci/100_environments/webdav.drawio.svg) <!-- .element: style="width: 70%;" -->
Expand All @@ -22,7 +24,7 @@ WebDAV endpoints emulate deployment targets

---

## Hands-On (1/2)
## Hands-On

See chapter [Environments](/hands-on/20231130/100_environments/exercise/)

Expand All @@ -35,10 +37,6 @@ Branches can be used to represent target environments:
- `dev` for development branch
- `live` for production code

### Hands-On (2/2)

See chapter [Environments](/hands-on/20231130/100_environments/exercise/)

---

## Pro tip: Disposable environments
Expand Down Expand Up @@ -70,4 +68,4 @@ vscode-cleanup:
script: echo DESTROY
```
<!-- .element: style="font-size: x-large;" -->
<!-- .element: style="font-size: x-large;" -->
44 changes: 33 additions & 11 deletions slides/2023-11-30/160_gitlab_ci/110_triggers/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ The following pipeline is downstream

![](160_gitlab_ci/110_triggers/upstream_downstream.drawio.svg) <!-- .element: style="width: 50%; margin-top: 0.5em;" -->

### Hands-On: Trigger tokens

See chapter [Triggers](/hands-on/20231130/110_triggers/exercise/)

---

## Heads-up for trigger tokens
Expand All @@ -61,27 +57,53 @@ Trigger owner must be able to either...

## Multi-project pipelines

Modern alternative to trigger tokens

Launch pipeline in separate project [](https://docs.gitlab.com/ee/ci/pipelines/multi_project_pipelines.html)

Use the `trigger` keyword [](https://docs.gitlab.com/ee/ci/yaml/index.html#trigger)

### Hands-On
### Example

See chapter [Triggers](/hands-on/20231130/110_triggers/exercise/)
```yaml
job_name:
trigger:
project: <path-to-project>
branch: main
```
`trigger.branch` is optional

---

## Hands-On: Parent-child pipelines

See chapter [Triggers](/hands-on/20231130/110_triggers/exercise/)
## Parent-child pipelines

Child pipeline can be made from multiple files

`include` supports `local` for files in the same repository

Use `project`/`ref`/`file` for files in other repositories

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

```yaml
job_name:
trigger:
include: <relative-path-to-file>
job_name2:
trigger:
include:
- project: <path-to-project>
ref: main
file: <relative-path-to-file>
```

---

## Hands-On

See chapter [Triggers](/hands-on/20231130/110_triggers/exercise/)

---

Expand Down Expand Up @@ -128,7 +150,7 @@ job_name:

## Dynamic includes

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

```yaml
generate:
Expand Down
74 changes: 71 additions & 3 deletions slides/2023-11-30/160_gitlab_ci/120_templates/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,34 @@ See also the official development guide for templates [](https://docs.gitlab.com

---

## Templates
## Templates 1/

The following pipeline...

```yaml
.template:
image: alpine
script: pwd

job_name:
extends: .template
```
...result in the following job:
```yaml
job_name:
image: alpine
script: pwd
```
Example:
Keywords from `job_name` are applied after keywords from `.template`

---

## Templates 2/

The following pipeline...

```yaml
.template:
Expand All @@ -37,11 +62,54 @@ Example:
job_name:
extends: .template
script: ls -l
```

...result in the following job:

```yaml
job_name:
image: alpine
script: ls -l
```

Keywords from `job_name` are applied after keywords from `.template`

### Hands-On
---

## Templates 3/3

The following pipeline...

```yaml
.template:
image: alpine
variables:
foo: bar
script: pwd
job_name:
extends: .template
variables:
bar: baz
```

...result in the following job:

```yaml
job_name:
image: alpine
variables:
foo: bar
bar: baz
script: pwd
```

Variables are merged!

---

## Hands-On

See chapter [Templates](/hands-on/20231130/120_templates/exercise/)

Expand Down

0 comments on commit 587011e

Please sign in to comment.