gitlab-org--gitlab-foss/doc/ci
Kamil Trzciński fc6ee35928 Merge branch 'feature-ci-only-except-trigger' into 'master'
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
2016-03-22 09:42:40 +00:00
..
api Update format of documentation for CI API 2016-03-01 10:57:12 +01:00
build_artifacts Fix typo on artifacts doc 2016-01-27 09:02:02 +01:00
deployment Fix typo in README.md. 2016-03-16 18:04:42 +00:00
docker Updated Docker Fundamentals link as suggested by @axil 2016-02-11 16:03:31 +00:00
examples Fix typo in Ruby CI test and deploy example 2016-03-14 13:21:31 +00:00
img Add documentation on enabling/disabling GitLab CI 2016-01-06 20:18:27 +01:00
permissions Groundwork for merging CI into CE 2015-08-25 18:42:46 -07:00
quick_start Reduce example documentation. 2016-03-10 08:13:11 -08:00
runners Update docs for shared runner default settings 2016-01-10 08:29:50 -05:00
services Reorganize CI sections and give descriptive names to links 2016-02-29 14:44:08 +02:00
ssh_keys Clean up CI ssh keys docs [ci skip] 2015-12-08 18:26:54 +02:00
triggers Fix typo on triggers docs [ci skip] 2015-12-26 13:56:33 +02:00
variables Add link to triggers doc in variables section 2016-03-01 09:57:09 +02:00
yaml Merge branch 'feature-ci-only-except-trigger' into 'master' 2016-03-22 09:42:40 +00:00
README.md Reduce example documentation. 2016-03-10 08:13:11 -08:00
enable_or_disable_ci.md Fix incorrect gitlab.rb variable in CI docs 2016-03-11 21:26:18 +02:00