CI: Add 'triggers' keyword to 'only' and 'except' lists to allow control over when triggers cause builds to run
Currently, the `only` and `except` keywords in `.gitlab-ci.yml` only accept ref names or the special `branches` and `tags` keywords. However, these are primarily useful when controlling how repository activity affects the creation of builds. In my case, instead of building on every commit, I'd like to use the following logic:
- If the repository is tagged, do a build.
- Any other normal commits should not cause a build.
- If a build is triggered via the API, always create one for the specified ref.
From what I can tell, this isn't possible via the existing YAML syntax. In this MR, I introduce a new keyword `triggers` that goes along with `branches` and `tags`. I can implement the logic above using the following job configuration:
```yaml
only:
- tags
- triggers
```
I updated the tests and documentation to reflect this and everything seems to pass.
See merge request !3230
This allows to reuse one job as a template for another one:
```
job1: &JOBTMPL
script: execute-script-for-job
job2: *JOBTMPL
```
This also helps to solve some of the issues in #342
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Fabio Huser <fabio.huser@siemens.com>
Additional specs cover a case when one of the builds is running but
allowed to fail. Previous implementation returned `running` status,
which is wrong. This behavior has been changed in 8.5, this commit adds
missing specs.
Before this fix when there was only one relevant, previous build and it
failed, but was allowed to fail, entire build had been marked as
skipped.
Closes#3192
Enable rubocop metrics
This enables rubocop metrics like CyclomaticComplexity and ABCSize.
Initial threshold values are high, should be probably decreased.
See merge request !1802
- Offloads uploading to GitLab Workhorse
- Use /authorize request for fast uploading
- Added backup recipes for artifacts
- Support download acceleration using X-Sendfile