Bash library
The internal Bash library for CI Tools is used in all components but can be also used standalone.
Usage¶
To load the library simply execute the command:
source <( curl -s https://gitlab.com/xrow-public/ci-tools/-/raw/main/scripts/bootloader.sh ) [version]
Replace [version] with either a branch name like main or a proper release version like 4.94.2.
source <(curl -s https://gitlab.com/xrow-public/ci-tools/-/raw/main/scripts/bootloader.sh) 4.94.2
Afterwards you can execute any function of the available modules, for example:
ci_helm_build_chart ./chart
How jobs interact with the bash scripting library?¶
Some components delegate business logic to bash scripts available via a common library in scripts/library.sh. Each individual pipeline reuses some parts of the library. Components are loading the library as a remote script source <(curl -s https://gitlab.com/xrow-public/ci-tools/-/raw/main/scripts/library.sh). ci_lint_javascript is a function out of the library scripts/lib/lint.sh. By convention the prefix of the function lint indicates use and location of the function.
Example from templates/s2i-php/template.yml:
lint:javascript:
script:
- |
source <(curl -s https://gitlab.com/xrow-public/ci-tools/-/raw/main/scripts/library.sh) main
ci_lint_javascript