mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 05:14:06 -06:00
2.6 KiB
2.6 KiB
| title | sr-due | sr-interval | sr-ease | tags | ||
|---|---|---|---|---|---|---|
| 11-continuous-integration-2 | 2022-04-07 | 3 | 250 |
|
- apprecitae that gitlab is a xomplex software
- Understand where CI jobs scripts get run
- explain why reposityory servers can host websites
- Understandhow gitblab dternmimines awhen a CI script failed
- Describe a way in which CI scrupts scan handle secrets
- OUtline uses of local git hook scripts
CI runs pipellines defined in .gitlab-ci.yaml asynchronously
CI usually tets abd buiolds your prokects
runs on a repo server. Usuially persistent, internet accessible
0.1 Gitlab overall architecture
- many different services used
0.2 Gitlab runners
run CI scripts
- gitlab.com is a cloud computing service
- allows elf hosting which is what CS does
- altitude is a gitlab instance at CS
- servers to host runners that run CI scripts
- servers that host websites, e.g., cspages.otago.nz
- altitude is a gitlab instance at CS
- Gitlab can invoke runners that you host
- e.g., to use a particular GPU, or other hardware you have
- GItlab runner itself is a small program written in Go
0.2.1 Runner architecture
- runs jobs
- on isolated infrastructure
- ... to maintain secrity
- that is set up on demand
- ... handle load variation
- suits cloud computing
RHS shows GitLab.com's CI hosting: uses google cloud
0.3 How CI chagned website hosting
- need to share stifacts produced by CI jobs
- using the web to share artefacts is ideal
- so now most repo servers also host websites
- these are static websites: all content is fixed
- CI can run static website generators (SSGs)
- git repo contains source code of website
- CI pipelines transforms souce code into HTML fiels
- HTML files then hosted as a website by repo sever
e.g., https://cosc202.cspages.otago.ac.nz
0.4 Debugging CI scripts
- first ensure config files YAML is valid
- vuilt in gitlab editor checks YAML as you type
- commands runfrom shell that fail return an exit code
- most unix shells sotre exit code of previous commands in $
- So if variable $? (return code of prevous command) is non-zero, the previous command failed
- Git lab considers CI job as failed if any command fails
- your shell scripting can choose to hide this exit code
- e.g.,
if command supposed to fail; then true; else true; fi
- e.g.,
- Complex scripting? Beste to put script in a file and run it from CI
- your shell scripting can choose to hide this exit code




