gitlab-org--gitlab-foss/spec
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
..
config
controllers Merge branch 'master' into issue_12658 2016-03-21 23:22:21 +01:00
factories Fix specs 2016-03-21 09:09:59 +01:00
features Address feedback 2016-03-22 00:09:20 +01:00
finders Fix specs 2016-03-22 00:23:58 +01:00
fixtures Add support for keyword arguments in label reference method 2016-03-03 10:41:11 +01:00
helpers Merge branch 'master' into issue_12658 2016-03-21 23:22:21 +01:00
initializers
javascripts Change `js-quick-submit` behavior to expect the class on the form 2016-03-02 15:11:15 -05:00
lib Merge branch 'feature-ci-only-except-trigger' into 'master' 2016-03-22 09:42:40 +00:00
mailers Add new notifications for issue move action 2016-03-17 07:39:16 +01:00
models Address feedback 2016-03-22 00:09:20 +01:00
requests Merge branch 'master' into issue_12658 2016-03-21 23:22:21 +01:00
routing Remove `Profile::KeysController#new` action 2016-03-03 16:13:59 -05:00
services Merge branch 'master' into issue_12658 2016-03-21 23:22:21 +01:00
support Tweaks, refactoring, and specs 2016-03-20 21:04:07 +01:00
tasks/gitlab
views
workers Cache output of Repository#exists? 2016-03-19 21:54:08 +01:00
factories_spec.rb
rails_helper.rb
spec_helper.rb Original implementation to allow users to subscribe to labels 2016-03-15 17:25:37 +01:00
teaspoon_env.rb