Skip to content

Commit b5c7de9

Browse files
committed
Final content for first day of 20231130/20231207
1 parent 58291c2 commit b5c7de9

File tree

32 files changed

+418
-244
lines changed

32 files changed

+418
-244
lines changed

160_gitlab_ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ nav:
8989
- GitLab: 000_rollout/exercise_gitlab.md
9090
- IDE: 000_rollout/exercise_ide.md
9191
- Project: 000_rollout/exercise_project.md
92+
- You are ready: you_are_ready.md
9293
- Basics:
9394
- Jobs and Stages: 010_jobs_and_stages/exercise.md
9495
- Variables: 020_variables/exercise.md
@@ -97,6 +98,7 @@ nav:
9798
- Defaults: 050_defaults/exercise.md
9899
- Artifacts: 060_artifacts/exercise.md
99100
- Job Dependencies: 065_job_dependencies/exercise.md
101+
- Schedules: 070_schedules/exercise.md
100102
- Unit Tests: 090_unit_tests/exercise.md
101103
- Advanced:
102104
- Environments: 100_environments/exercise.md

160_gitlab_ci/000_rollout/exercise_project.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Your instance of Visual Studio Code is provisioned with your credentials to allo
99

1010
## Task 2: Pulling from the upstream repository
1111

12-
XXX
12+
The local clone of the `demo` project is configured with a remote pointing to the location of [the original project on GitHub](https://github.com/nicholasdille/container-slides). This is prepared in case the instructor needs to fix a demo. Let's test this safeguard:
1313

1414
1. Open a terminal
1515
1. Change to the `demo` project directory
1616
1. List remotes: `git remote -v`
17-
1. Pull from the upstream repository: `git pull upstream --all`
17+
1. Pull from the upstream repository: `git pull upstream`

160_gitlab_ci/000_rollout/slides.md

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,10 @@
66

77
---
88

9-
## GitLab
9+
## Environment
1010

11-
Deploy a containerized stack for this workshop
11+
Containerized service stack for this workshop
1212

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

15-
Obviously GitLab <i class="fa-duotone fa-face-smile-wink fa-duotone-colors"></i>
16-
17-
traefik routes requests to containers
18-
19-
---
20-
21-
## Problems with credentials
22-
23-
If your credentials are not working:
24-
25-
1. Go to https://code.inmylab.de
26-
1. Click on "Show username and password"
27-
1. Authenticate using the user `seat` and your code
28-
29-
The code was provided as part of your credentials:
30-
31-
```plaintext
32-
code;hostname;username;password
33-
ABCDE;seatN.inmylab.de;seatN;0123456789abcdef0123456789abcdef
34-
```
35-
36-
OR
37-
38-
```plaintext
39-
Host seatN.vscode.inmylab.de
40-
User seatN
41-
Code ABCDE
42-
Password 0123456789abcdef0123456789abcdef
43-
```
44-
45-
---
46-
47-
## Code
48-
49-
The source for the slides as well as the demos are located in my repository called [container-slides](https://github.com/nicholasdille/container-slides)
50-
51-
Please refer to the release matching the date of your workshop
52-
53-
You should use the release tag to access the files in the repository
54-
55-
The hands-on chapters have a link to the exact directory in the repository
56-
57-
### Demos tell a story
58-
59-
Demos focus on a single feature
60-
61-
Each demo improves the previous state
62-
63-
All demos will have unanswered questions
64-
65-
Following demos will again improve
15+
See [introduction](/hands-on/2023-11-30/)

160_gitlab_ci/010_jobs_and_stages/exercise.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
112112
Both jobs `lint` and `audit` must be in the stage `check`.
113113

114114
??? example "Solution (Click if you are stuck)"
115+
`.gitlab-ci.yml`:
116+
115117
```yaml linenums="1" hl_lines="5-17"
116118
stages:
117119
- check

160_gitlab_ci/020_variables/ci.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ Available in project-, group- and instance-level
1010

1111
Careful with protected variables
1212

13-
---
14-
15-
## Hands-On
13+
### Hands-On
1614

1715
See chapter [Variables](/hands-on/20231130/020_variables/exercise/)
1816

160_gitlab_ci/020_variables/exercise.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
3030
2. Replace the build command with the one provided above
3131

3232
??? example "Solution (Click if you are stuck)"
33+
`.gitlab-ci.yml`:
34+
3335
```yaml linenums="1" hl_lines="21-22 26-30"
3436
stages:
3537
- check
@@ -79,6 +81,8 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
7981
2. Replace the variable `${version}` with the predefined variable `${CI_COMMIT_REF_NAME}`
8082

8183
??? example "Solution (Click if you are stuck)"
84+
`.gitlab-ci.yml`:
85+
8286
```yaml linenums="1" hl_lines="25-28"
8387
stages:
8488
- check
@@ -137,6 +141,8 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
137141
The `-ldflags` option needs to be extended with `-X 'main.Author=${AUTHOR}'`
138142

139143
??? example "Solution (Click if you are stuck)"
144+
`.gitlab-ci.yml`:
145+
140146
```yaml linenums="1" hl_lines="25-28"
141147
stages:
142148
- check
@@ -172,3 +178,7 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
172178
If you want to jump to the solution, execute the following command:
173179

174180
git checkout origin/160_gitlab_ci/020_variables/ci -- '*'
181+
182+
<!-- TODO: masked variables -->
183+
184+
<!-- TODO: protected variables -->

160_gitlab_ci/020_variables/slides.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ Variables [](https://docs.gitlab.com/ee/ci/yaml/#variables) can be...
1414
- predefined by GitLab
1515
- defined in the UI
1616

17-
---
18-
19-
## Hands-On
17+
### Hands-On
2018

2119
See chapter [Variables](/hands-on/20231130/020_variables/exercise/)

160_gitlab_ci/030_script_blocks/exercise.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Afterwards check the pipeline in the GitLab UI. You should see a successful pipe
1818
Move calls to `apk` to the `before_script`.
1919

2020
??? example "Solution (Click if you are stuck)"
21+
`.gitlab-ci.yml`:
22+
2123
```yaml linenums="1" hl_lines="7-9 15-17 23-25"
2224
stages:
2325
- check

160_gitlab_ci/040_image/exercise.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
Learn how to...
55

66
- specify which container image to use for a job
7-
- XXX
7+
- tailor the execution environment to your needs
88

99
## Task: Simplify using container images
1010

1111
In the previous exampes, we called `apk` at the beginning of every job to install Go. This had to be repeated for every job because Go was not present. Choosing an image for a job using the `image` directive, time is saved by avoiding commands to install required tools. See the [official documentation](https://docs.gitlab.com/ee/ci/yaml/#image).
1212

1313
Replace the calls to `apk` with the container image `golang:1.19.2`.
1414

15-
XXX version bump for `golang` image
16-
1715
Afterwards check the pipeline in the GitLab UI. You should see a successful pipeline run.
1816

1917
??? info "Hint (Click if you are stuck)"
2018
- Remove `before_script`
2119
- Add `image: golang:1.19.2` instead
2220

2321
??? example "Solution (Click if you are stuck)"
22+
`.gitlab-ci.yml`:
23+
2424
```yaml linenums="1" hl_lines="7 13 19"
2525
stages:
2626
- check

160_gitlab_ci/040_image/slides.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ Do not use community images
1818

1919
Avoid maintaining custom image
2020

21-
---
22-
23-
## Hands-On
21+
### Hands-On
2422

2523
See chapter [Variables](/hands-on/20231130/040_image/exercise/)

0 commit comments

Comments
 (0)