Merge requests enable collaboration
Pipelines can automatically test merge requests
Commits to a branch with a merge request cause multiple events:
Use rules to decide which jobs to run when
GitLab offers $CI_PIPELINE_SOURCE
with event name
Only run when configured using the rules
keyword
Have access to more pre-defined variables
Do not have access to protected variables
Pipelines often have many jobs
Rules will be repeated multiple times
Combine rules with templates to prevent repetition
.rule-only-web:
rules:
- if: $CI_PIPELINE_SOURCE == 'web'
job_name:
extends:
- .rule-only-web
#...
See chapter Merge requests
Write scan results into merge request
Requires Developer Edition
Wait for quality gates:
sonar-scanner -Dsonar.qualitygate.wait=true