Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit ab7d256

Browse files
committed
Various minor fixes
- use yaml in markdown code - lists in references - fixes in some exercises
1 parent 1780970 commit ab7d256

File tree

5 files changed

+67
-56
lines changed

5 files changed

+67
-56
lines changed

_images/server/git_server_gitlab.png

-943 KB
Loading

day1/05_Branching/02_head_smart_pointers.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ Hint: Git stores this information in the file `.git/HEAD`.
4747

4848
@@@ Sh
4949
$ cd $HOME/training
50-
51-
@@@ Sh
5250
$ git show HEAD^
5351

5452
or

day1/07_Collaboration/04_Advanced.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ stages, `git stash list` will list them.
160160
* Hint: When the base commit differs, the checksum changes, thus new commit ID
161161
* `-x` can be used to keep a reference to the original commit
162162
163+
Example use-case: backporting patches to older software version.
164+
163165
Example:
164166
165167
$ git cherry-pick -x ef5d1c2

day2/03_CI/03_Gitlab_CI.md

Lines changed: 49 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ Example:
4747
4848
References:
4949
50-
https://docs.gitlab.com/runner/install/linux-repository.html
51-
52-
https://docs.gitlab.com/runner/register/index.html
50+
* https://docs.gitlab.com/runner/install/linux-repository.html
51+
* https://docs.gitlab.com/runner/register/index.html
5352
5453
~~~ENDSECTION~~~
5554
@@ -92,11 +91,9 @@ Hint: GitLab offers an integrated Container Registry to store container images f
9291
9392
References:
9493
95-
https://docs.docker.com
96-
97-
https://podman.io/
98-
99-
https://docs.gitlab.com/runner/install/docker.html
94+
* https://docs.docker.com
95+
* https://podman.io/
96+
* https://docs.gitlab.com/runner/install/docker.html
10097
10198
~~~ENDSECTION~~~
10299
@@ -116,7 +113,7 @@ https://docs.gitlab.com/runner/install/docker.html
116113
117114
Reference:
118115
119-
https://docs.gitlab.com/runner/install/
116+
* https://docs.gitlab.com/runner/install/
120117
121118
~~~ENDSECTION~~~
122119
@@ -154,6 +151,7 @@ Note: Runners can be defined per Instance, Group or Project.
154151
155152
You can install your own runner:
156153
154+
@@@Sh
157155
sudo yum install -y yum-utils
158156
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
159157
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
@@ -176,6 +174,7 @@ In the .gitlab-ci.yml file, you can define:
176174
177175
Example:
178176
177+
@@@Yaml
179178
image: docker.io/alpine:latest
180179
181180
name_of_my_job:
@@ -203,9 +202,10 @@ https://docs.gitlab.com/ee/ci/yaml/gitlab_ci_yaml.html
203202
204203
Example:
205204
205+
@@@Yaml
206206
image: docker.io/alpine:latest
207207
208-
my_tests:
208+
my_job:
209209
script:
210210
- exit 1
211211
@@ -224,9 +224,12 @@ Example:
224224
225225
Example:
226226
227+
<!-- -->
228+
229+
@@@Yaml
227230
image: docker.io/alpine:latest
228231
229-
my_tests:
232+
my_job:
230233
script:
231234
- exit 1
232235
@@ -243,10 +246,12 @@ Example:
243246
* Navigate your GitLab Web interface and click the button 'Web IDE'
244247
* Click 'Add file' and create the `.gitlab-ci.yml` file from the suggestions
245248
246-
@@@ Sh
249+
<!-- -->
247250
251+
@@@Yaml
248252
image: docker.io/alpine:latest
249-
my_tests:
253+
254+
my_job:
250255
script:
251256
- exit 1
252257
@@ -291,11 +296,10 @@ Future examples and tests work the same way.
291296
292297
### Modify exit code
293298
294-
@@@ Sh
295-
299+
@@@Yaml
296300
image: docker.io/alpine:latest
297301
298-
all_tests:
302+
my_job:
299303
script:
300304
- exit 0
301305
@@ -355,6 +359,7 @@ Reference: https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management
355359
356360
Example:
357361
362+
@@@Yaml
358363
before_script:
359364
- apk update && apk add python3 py-pip
360365
- pip install --break-system-packages markdown Pygments pymarkdownlnt
@@ -369,15 +374,15 @@ Example:
369374
370375
### Edit .gitlab-ci.yml and add before_script
371376
372-
@@@ Sh
377+
@@@Yaml
373378
374379
image: docker.io/alpine:latest
375380
376381
before_script:
377382
378383
### Update apk and install Python/pip
379384
380-
@@@ Sh
385+
@@@Yaml
381386
382387
image: docker.io/alpine:latest
383388
@@ -386,7 +391,7 @@ Example:
386391
387392
### Install Markdown Python libraries
388393
389-
@@@ Sh
394+
@@@Yaml
390395
391396
image: docker.io/alpine:latest
392397
@@ -396,15 +401,15 @@ Example:
396401
397402
### Verify the content
398403
399-
@@@ Sh
404+
@@@Yaml
400405
401406
image: docker.io/alpine:latest
402407
403408
before_script:
404409
- apk update && apk add python3 py-pip
405410
- pip install --break-system-packages markdown Pygments pymarkdownlnt
406411
407-
all_tests:
412+
my_job:
408413
script:
409414
- exit 0
410415
@@ -428,7 +433,8 @@ This is an example of how to do it from a CLI, the Gitlab WebIDE is an obvious a
428433
429434
Example:
430435
431-
my_tests:
436+
@@@Yaml
437+
lint_markdown:
432438
script:
433439
- pymarkdown scan README.md
434440
allow_failure: true
@@ -449,7 +455,8 @@ Example:
449455
450456
Example:
451457
452-
my_tests:
458+
@@@Yaml
459+
lint_markdown:
453460
script:
454461
- pymarkdown scan README.md
455462
allow_failure: true
@@ -464,9 +471,8 @@ Example:
464471
465472
### Edit .gitlab-ci.yml and modify the job
466473
467-
@@@ Sh
468-
469-
my_tests:
474+
@@@Yaml
475+
lint_markdown:
470476
script:
471477
- pymarkdown scan README.md
472478
allow_failure: true
@@ -483,7 +489,8 @@ Example:
483489
484490
Example:
485491
486-
markdown:
492+
@@@Yaml
493+
convert_markdown:
487494
script:
488495
- python3 -m markdown README.md > README.html
489496
artifacts:
@@ -517,23 +524,23 @@ Example:
517524
518525
### Edit .gitlab-ci.yml and add markdown section
519526
520-
@@@ Sh
527+
@@@Yaml
521528
522529
...
523530
524-
all_tests:
531+
my_job:
525532
script:
526533
- exit 0
527534
528-
markdown:
535+
convert_markdown:
529536
530537
### Add script to convert Markdown into HTML
531538
532-
@@@ Sh
539+
@@@Yaml
533540
534541
...
535542
536-
markdown:
543+
convert_markdown:
537544
script:
538545
- python3 -m markdown README.md > README.html
539546
@@ -542,11 +549,11 @@ Example:
542549
Add `paths` section which includes `README.html` as entry.
543550
Tell GitLab to expire this artifact in `1 week`.
544551
545-
@@@ Sh
552+
@@@Yaml
546553
547554
...
548555
549-
markdown:
556+
convert_markdown:
550557
script:
551558
- python3 -m markdown README.md > README.html
552559
artifacts:
@@ -556,19 +563,19 @@ Tell GitLab to expire this artifact in `1 week`.
556563
557564
### Verify the content
558565
559-
@@@ Sh
566+
@@@Yaml
560567
561568
image: docker.io/alpine:latest
562569
563570
before_script:
564571
- apk update && apk add python3 py-pip
565572
- pip install --break-system-packages markdown Pygments pymarkdownlnt
566573
567-
all_tests:
574+
my_job:
568575
script:
569576
- exit 0
570577
571-
markdown:
578+
convert_markdown:
572579
- python3 -m markdown README.md > README.html
573580
artifacts:
574581
paths:
@@ -673,6 +680,7 @@ CI Variables are environment variables that are accessible in the job.
673680
674681
Example:
675682
683+
@@@Yaml
676684
job1:
677685
script:
678686
- echo "Job for the Commit: '$CI_COMMIT_SHA'"
@@ -691,12 +699,13 @@ Usecases: Credentials (`AWS_ACCESS_KEY`) or controlling builds (`CMAKE_C_FLAGS`)
691699
692700
Example:
693701
702+
@@@Yaml
694703
job_name
695704
script:
696-
- echo $MYVAR
705+
- echo $PLATFORM
697706
parallel:
698707
matrix:
699-
- MYVAR: [hello, hallo]
708+
- PLATFORM: [Linux, Windows, macOS]
700709
701710
!SLIDE supplemental exercises
702711
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Add jobs using variables
@@ -722,6 +731,7 @@ Example:
722731
723732
Example:
724733
734+
@@@Yaml
725735
my_parallel_job:
726736
before_script:
727737
- env

0 commit comments

Comments
 (0)