Skip to content

Commit 83146f1

Browse files
committed
Filled many open spots after 20241112
1 parent 762e89a commit 83146f1

File tree

10 files changed

+139
-32
lines changed

10 files changed

+139
-32
lines changed

160_gitlab_ci/000_rollout/vscode/vscode/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ curl -sLf https://github.com/uniget-org/cli/releases/latest/download/uniget_linu
2525
uniget install \
2626
gojq \
2727
go \
28-
glab
28+
glab \
29+
gitlabci-local
2930
EOF
3031

3132
COPY --chmod=0755 git.sh /opt/entrypoint.d/

160_gitlab_ci/065_job_dependencies/slides.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ See chapter [Job dependencies](/hands-on/2024-11-12/065_job_dependencies/exercis
6666
6767
---
6868
69-
## Pro tip: XXX
69+
## Pro tip: Passing atifacts with `needs`
7070

71-
One stage with two jobs and `needs` -> artifacts work
71+
If you have one stage with two jobs where one depends on the other using `needs`, artifacts are passed correctly between them.
72+
73+
This is important to note because without `needs` jobs in the same stage to not receive artifacts from each other.

160_gitlab_ci/120_templates/exercise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Create a template for compiling a go binary from the job `build` and use it in t
1414
Afterwards check the pipeline in the GitLab UI. You should see a successful pipeline run.
1515

1616
??? info "Hint (Click if you are stuck)"
17-
XXX
17+
`.gitlab-ci.yml`:
1818

1919
```yaml
2020
.build-go:

160_gitlab_ci/130_rules/slides.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,11 @@ Template to disable job:
109109
110110
## Pro tip: Fields for rules
111111
112-
XXX variables [](https://docs.gitlab.com/ee/ci/yaml/#rulesvariables)
112+
Rules not only control execution of jobs but can also configure jobs through the use of the following fields:
113113
114-
XXX variable precedence
114+
- Add additional `variables` [](https://docs.gitlab.com/ee/ci/yaml/#rulesvariables) to customize the behaviour of the job
115+
- Limit a rule to changes `changes` [](https://docs.gitlab.com/ee/ci/yaml/#ruleschanges) on specific files
116+
- Execute a job only if a specific file `exists` [](https://docs.gitlab.com/ee/ci/yaml/#rulesexists)
117+
- Make a job dependent on other jobs using `needs` [](https://docs.gitlab.com/ee/ci/yaml/#rulesneeds)
115118

116-
XXX changes [](https://docs.gitlab.com/ee/ci/yaml/#ruleschanges)
117-
118-
XXX exists [](https://docs.gitlab.com/ee/ci/yaml/#rulesexists)
119-
120-
XXX needs [](https://docs.gitlab.com/ee/ci/yaml/#rulesneeds)
119+
Rules become especially powerful when combining the fields supported by rules - including `if`
+44-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,55 @@
11
# Troubleshooting
22

33
!!! tip "Goal"
4-
Learn how to...
5-
6-
- XXX
4+
Learn how to run a pipeline locally
75

86
## Preparation
97

10-
XXX
8+
Open a terminal and make sure the working directory is your repository.
9+
10+
## Task 1: Run a single job
1111

12-
## Task: Use gcil
12+
Select a single job to run:
1313

1414
```shell
1515
gcil
16-
gcil -p
17-
gcil -l
1816
```
17+
18+
## Task 2: Run the whole pipeline
19+
20+
Run the whole pipeline:
21+
22+
```shell
23+
gcil --pipeline
24+
```
25+
26+
## Task 3: Explore pre-defined variables
27+
28+
Add a job to print all environment variables.
29+
30+
??? info "Hint (Click if you are stuck)"
31+
Use the following command to show all environment variables: `printenv | sort`
32+
33+
??? example "Solution (Click if you are stuck)"
34+
35+
```yaml
36+
#...
37+
new_job:
38+
stage: check
39+
script: |
40+
printenv | sort
41+
#...
42+
```
43+
44+
## Task 4: Pass variables to the pipeline
45+
46+
Check the help how to pass a variable called `AUTHOR` with a value of your choice.
47+
48+
??? info "Hint (Click if you are stuck)"
49+
The parameter `-e` is used to pass variables to the pipeline.
50+
51+
??? example "Solution (Click if you are stuck)"
52+
53+
```shell
54+
gcil --pipeline --pipeline -e FOO=bar
55+
```

160_gitlab_ci/255_troubleshooting/slides.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,17 @@ Use `command || true` is dangerous because it hides errors
3030

3131
## Shotgun debugging
3232

33-
XXX many echos
33+
Adding many `echo` stagements is the most prominent (and hated) approach
3434

35-
XXX if then else
35+
Better add regular output to the script blocks...
36+
37+
...especially when using multi-line commands
38+
39+
Add output to both branches of `if-then-else` statements
40+
41+
Consider moving commands to a script file...
42+
43+
...this can enable local debugging
3644

3745
---
3846

@@ -44,7 +52,7 @@ Run whole pipelines locally using `gcil` (formerly `gitlabci-local`) [](https://
4452

4553
Supports shell and Docker executor
4654

47-
XXX
55+
Runs one or more jobs or even the whole pipeline
4856

4957
### ~~gitlab-runner~~
5058

160_gitlab_ci/260_runners/slides.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,15 @@ All features work across different runners
9393
9494
## Pro tip: Finding existing runners
9595
96-
XXX
96+
No single place to discover runners
97+
98+
See the CI/CD settings in the runner section
99+
100+
Applies to groups and projects
101+
102+
The list shows runners available
103+
104+
Offers the option to disable instance runners
97105
98106
---
99107

160_gitlab_ci/265_caches/slides.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ See chapter [caches](/hands-on/2024-11-12/265_caches/exercise/)
3434

3535
## Pro tip: Clear the cache
3636

37-
XXX [](https://docs.gitlab.com/ee/ci/caching/#clearing-the-cache)
37+
Clear the cache [](https://docs.gitlab.com/ee/ci/caching/#clearing-the-cache) in two ways:
38+
39+
1. Change the cache key in your pipeline
40+
1. On the pipeline page, click `Clear runner caches` in the upper right corner
3841

3942
---
4043

4144
## Pro tip 2: Runner local cache
4245

43-
XXX [](https://docs.gitlab.com/ee/ci/caching/#where-the-caches-are-stored)
46+
For some executors, the runner stores the cache locally [](https://docs.gitlab.com/ee/ci/caching/#where-the-caches-are-stored) when not configured otherwise
4447

45-
Shell: /home/gitlab-runner/cache/<user>/<project>/<cache-key>/cache.zip
48+
The local cache is located in the following directories:
4649

47-
Docker: /var/lib/docker/volumes/<volume-id>/_data/<user>/<project>/<cache-key>/cache.zip
50+
- Shell: `/home/gitlab-runner/cache/<user>/<project>/<cache-key>/cache.zip`
51+
- Docker: `/var/lib/docker/volumes/<volume-id>/_data/<user>/<project>/<cache-key>/cache.zip`

160_gitlab_ci/320_secure_files/exercise.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
!!! tip "Goal"
44
Learn how to...
55

6-
- XXX
6+
- Upload secure files
7+
- Use secure files in a job
78

89
!!! tip "Hints"
910
[Official documentation](https://docs.gitlab.com/ee/ci/secure_files/) for Secure Files
1011

11-
## Task: XXX
12+
## Task 1: Upload a secure file
13+
14+
XXX
15+
16+
## Task 2: Use the secure file
1217

1318
XXX

160_gitlab_ci/320_secure_files/slides.md

+47-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,57 @@
22

33
<i class="fa-duotone fa-box-open-full fa-8x fa-duotone-colors" style="float: right; color: grey;"></i>
44

5-
## Secure Files
5+
## Secure Files (experimental)
66

77
---
88

9-
## Secure Files
9+
## Secure Files (experimental)
1010

1111
<i class="fa-duotone fa-solid fa-4x fa-sparkles"></i> <!-- .element: style="float: right;" -->
1212

13-
XXX [](https://docs.gitlab.com/ee/ci/secure_files/)
13+
Secure files [](https://docs.gitlab.com/ee/ci/secure_files/) are encrypted at rest
1414

15-
XXX [](https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files)
15+
Each secure file is encrypted with a unique key...
16+
17+
...and a SHA256 hash is stored in the database
18+
19+
Up to 100 files and up to 5MB per file
20+
21+
Binary files are supported
22+
23+
Stored outside the repository and are not version controlled
24+
25+
### Upload
26+
27+
Either through the UI [](https://docs.gitlab.com/ee/ci/secure_files/#add-a-secure-file-to-a-project)
28+
29+
Or through the API [](https://docs.gitlab.com/ee/api/secure_files.html)
30+
31+
The Developer role is required to access secure files
32+
33+
---
34+
35+
## Secure Files (experimental)
36+
37+
### Use secure files
38+
39+
Downloading secure files in a pipeline requires a binary [](https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files)
40+
41+
Environment variable `SECURE_FILES_DOWNLOAD_PATH` defines where files should be downloaded to
42+
43+
```yaml
44+
test:
45+
variables:
46+
SECURE_FILES_DOWNLOAD_PATH: './where/files/should/go/'
47+
script: |
48+
curl \
49+
--silent \
50+
--url "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" \
51+
| bash
52+
```
53+
54+
---
55+
56+
## Hands-On
57+
58+
See chapter [Secure Files](/hands-on/2024-11-12/320_secure_files/exercise/)

0 commit comments

Comments
 (0)