Skip to content

Commit

Permalink
Last updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Nov 30, 2023
1 parent 587011e commit 1d24723
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 55 deletions.
2 changes: 2 additions & 0 deletions slides/2023-11-30/160_gitlab_ci/000_rollout/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ Containerized service stack for this workshop

![](160_gitlab_ci/000_rollout/stack.drawio.svg) <!-- .element: style="width: 90%; margin-top: 1em;" -->

Available from 2023-11-30 at 9:00 until 2023-12-07 at 17:00

See [introduction](/hands-on/2023-11-30/)
17 changes: 14 additions & 3 deletions slides/2023-11-30/160_gitlab_ci/110_triggers/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,22 @@ Load stages and jobs from a file using `include` [](https://docs.gitlab.com/ee/c

## Nomenclature

The preceding pipeline is upstream
The preceding pipeline is **upstream**

The following pipeline is downstream
The following pipeline is **downstream**

![](160_gitlab_ci/110_triggers/upstream_downstream.drawio.svg) <!-- .element: style="width: 50%; margin-top: 0.5em;" -->
The pipeline triggering you is the **upstream pipeline**

The pipeline you trigger is the **downstream pipeline**

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

Relationship between pipelines in the above picture:

- Pipeline 1 is upstream of pipeline 2
- Pipeline 2 is downstream of pipeline 1
- Pipeline 2 is upstream of pipeline 3
- Pipeline 3 is downstream of pipeline 2

---

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 28 additions & 28 deletions slides/2023-11-30/160_gitlab_ci/130_rules/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ Formerly `only`/`except` [](https://docs.gitlab.com/ee/ci/yaml/#only--except) wh

Official documentation of job control [](https://docs.gitlab.com/ee/ci/jobs/job_control.html)

### Hands-On

See chapter [Rules](/hands-on/20231130/130_rules/exercise/)

---

## Make pipelines conditional
Expand All @@ -48,7 +44,7 @@ Conditions are also used in workflow rules

---

## Hands-On: Workflow rules
## Workflow rules

Disable execution for some trigger types

Expand All @@ -66,8 +62,6 @@ workflow:
when: never
```
See chapter [Rules](/hands-on/20231130/130_rules/exercise/)
---
## Pro tip: Mind the order
Expand All @@ -82,27 +76,6 @@ Adjust order from most specific...
---
## Pro tip: Rule templates
Pipelines often have many jobs
Rules will be repeated multiple times
Combine rules with templates to prevent repetition
```yaml
.rule-only-web:
rules:
- if: $CI_PIPELINE_SOURCE == 'web'

job_name:
extends:
- .rule-only-web
#...
```

---

## Pro tip: Use CI_DEPLOY_FREEZE with rules
Disable pipeline:
Expand All @@ -125,3 +98,30 @@ Template to disable job:
allow_failure: true
- when: on_success
```
---
## Hands-On
See chapter [Rules](/hands-on/20231130/130_rules/exercise/)
---
## Pro tip: Rule templates
Pipelines often have many jobs
Rules will be repeated multiple times
Combine rules with templates to prevent repetition
```yaml
.rule-only-web:
rules:
- if: $CI_PIPELINE_SOURCE == 'web'

job_name:
extends:
- .rule-only-web
#...
```
18 changes: 14 additions & 4 deletions slides/2023-11-30/160_gitlab_ci/140_merge_requests/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,27 @@ Pipelines can automatically test merge requests [](https://docs.gitlab.com/ee/ci

Commits to a branch with a merge request cause multiple events:

1. Push event to branch
1. Merge request event

XXX difference
1. Push event to branch -> **branch pipeline**
1. Merge request event -> **merge request pipeline**

Use rules [<i class="fa-solid fa-arrow-right-to-bracket"></i>](#/gitlab_rules) to decide which jobs to run when

GitLab offers `$CI_PIPELINE_SOURCE` with event name

---

## Merge request pipelines

### What make them different

Only run when configured using the `rules` keyword [](https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#use-rules-to-add-jobs)

Have access to more pre-defined variables [](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#predefined-variables-for-merge-request-pipelines)

Do not have access to protected variables

---

## Hands-On

See chapter [Merge requests](/hands-on/20231130/140_merge_requests/exercise/)

0 comments on commit 1d24723

Please sign in to comment.