Shell#
This is a “sub-pipeline” for linting new changes that have been made to shell scripts of a specific GitLab project.
Triggers#
All jobs from shell “sub-pipeline” stages are triggered only on merge requests and only if changes have been made to shell scripts. Right now such files are detected by these patterns:
**/*.sh
.
Jobs overview#
check:shell:format#
This job executes shfmt only on changed Shell files (not diff, but files) which will diagnose and fix style violations, or bugs that can be deduced via static analysis.
- ARTIFACTS
Job will generate a patch file with corrected lines.
- CONFIG
Configuration file is located at the root of the repository and has
.editorconfig
name.- DEPENDENCIES
Job doesn’t require artifacts from other jobs and has no dependencies from other stages or jobs.
ENVIRONMENT
Name |
Necessity |
Type |
---|---|---|
BPROTO_CI_LINTER_TRACE |
Optional |
Public |
BPROTO_CI_MERGE_REQUEST_CHANGED_FILES |
Mandatory |
Internal |
- IMAGES
- STAGE
- TRIGGERS
Job is triggered only on merge requests when any file from trigger list is changed.
check:shell:lint#
This job executes shellcheck only on changed Shell files (not diff, but files) which will diagnose and fix style violations like wrong variable and function names.
- ARTIFACTS
Job will generate a simple log file with all found issues.
- CONFIG
Configuration file is located at the root of the repository and has
.shellcheck
name.- DEPENDENCIES
Job doesn’t require artifacts from other jobs and has no dependencies from other stages or jobs.
ENVIRONMENT
Name |
Necessity |
Type |
---|---|---|
BPROTO_CI_LINTER_TRACE |
Optional |
Public |
BPROTO_CI_MERGE_REQUEST_CHANGED_FILES |
Mandatory |
Internal |
- IMAGES
- STAGE
- TRIGGERS
Job is triggered only on merge requests when any file from trigger list is changed.
Usage#
In order to use above CI jobs, you need to add the following code to your .gitlab-ci.yml:
include:
- project: 'bproto/cicd'
ref: main
file:
- '/.gitlab/ci/external/lite.yml'