Commit Graph
74 Commits
Author SHA1 Message Date
Rémy CoutableandRobert Speicher 7db27be140 Merge branch 'fix/error-when-job-variables-not-defined-but-specified' into 'master'
Fix error when CI job variables key used but not specified

## What does this MR do?

This MR fixes a an error when CI job variables specified, but not defined:

```yaml
image: ruby:2.2

test:
  variables:
  script:
     - rspec
```

## What are the relevant issue numbers?

Closes #18764  
Follow up discussion in: #18775 

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !4745
2016-06-17 14:22:18 -04:00
Rémy CoutableandRobert Speicher 4a6eb00729 Merge branch 'validate-only-except-regexp' into 'master'
Validate only and except regexp

## What does this MR do?
Adds a better validation for only and except which can contain regexps.

## Why was this MR needed?
Currently the RegexpError can be raised when processing next stage which leads to 500 in different places of code base.
This adds early check that regexps used in only and except are valid.

cc @grzesiek 

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !4736
2016-06-17 14:15:14 -04:00
Rémy CoutableandRobert Speicher 700a88a876 Merge branch 'fix/status-of-pipeline-without-builds' into 'master'
Improve pipeline status in case that pipeline has no jobs

## What does this MR do?

This MR resolves problem with pipeline status when there are no build in pipeline.

This can happen when builds were skipped - for example - by using `only`/`except` keyword in `.gitlab-ci.yml`.

## What are the relevant issue numbers?

Closes #17977

See merge request !4403
2016-06-16 13:28:06 -04:00
Kamil Trzcinski 006b650988 Merge remote-tracking branch 'origin/master' into environments-and-deployments
# Conflicts:
#	db/schema.rb
2016-06-14 16:19:29 +02:00
Kamil Trzcinski 975e388751 Merge remote-tracking branch 'origin/master' into environments-and-deployments
# Conflicts:
#	lib/ci/gitlab_ci_yaml_processor.rb
2016-06-14 14:53:10 +02:00
Kamil Trzcinski 3f5819fb7a Merge remote-tracking branch 'origin/master' into artifacts-expire-date 2016-06-14 14:49:59 +02:00
Kamil Trzcinski e8f09f02bf Validate environment name with regex 2016-06-14 13:04:21 +02:00
Rémy Coutable 47cdb69921 Merge branch 'refactor/ci-config-add-global-entry' into 'master'
Add global entry with before script to new CI config

## What does this MR do?

This MR adds a new entries to a new CI config class. It is next refactoring step after !4462.

See #15060

See merge request !4482
2016-06-14 10:53:26 +00:00
Kamil Trzcinski 7d9e8b04c0 Merge remote-tracking branch 'origin/master' into environments-and-deployments 2016-06-14 12:41:18 +02:00
Kamil TrzcinskiandPhil Hughes d23b91b0d9 Improve after review 2016-06-13 11:08:15 +01:00
Kamil TrzcinskiandPhil Hughes 1501940ee0 Validate artifacts:expire_in in yaml processor 2016-06-13 11:03:30 +01:00
Kamil TrzcinskiandPhil Hughes aea4041ce9 Allow to expire build artifacts 2016-06-13 11:01:19 +01:00
Kamil TrzcinskiandPhil Hughes 7a1b2e4f94 Added when to artifacts 2016-06-13 10:45:24 +01:00
Kamil Trzcinski 907c0e6796 Added initial version of deployments 2016-06-10 23:36:54 +02:00
Kamil Trzcinski 3714e1914b Improve after review 2016-06-10 21:25:48 +02:00
Kamil Trzcinski 81dfabad39 Added when to artifacts 2016-06-08 17:10:58 +02:00
Grzegorz Bizon cba266aabc Remove old before_script from legacy Ci config 2016-06-08 11:44:07 +02:00
Grzegorz Bizon 2b48da22ca Merge branch 'master' into refactor/ci-config-add-global-entry
* master: (285 commits)
  Bump recaptcha gem to 3.0.0 to remove deprecated stoken support
  Load knapsack in Rakefile only when is bundled
  Add License Finder information to contribution acceptance criteria.
  Add LGPLv2 to license whiltelist
  Instrument `RepositoryCheck::SingleRepositoryWorker` manually
  Bump nokogiri to 1.6.8
  Fix alignment of wiki top area
  Update charcoal theme colors
  Update nav link font size and spacing; fix hamburger icon
  Fix control btn position
  Remove todos count tests in nav
  Test impersonation using img data attribute instead of username
  Implement compact side nav
  Fix knapsack for master
  Align links and tabs
  Add scrolling tabs to code subnav
  Finish styling sub nav
  Updated colors
  Fixed failing tests
  CHANGELOG item
  ...

Conflicts:
	lib/gitlab/ci/config.rb
	spec/lib/gitlab/ci/config_spec.rb
2016-06-08 11:38:56 +02:00
Grzegorz Bizon 70bda3e89b Implement script in Ci config and use in legacy one 2016-06-07 14:23:47 +02:00
Grzegorz Bizon df25c19699 Use Ci config validation helpers only where needed 2016-06-07 12:58:32 +02:00
Grzegorz Bizon fa097c678c Remove duplicated exception in Ci config
This is a temporary refactoring stub, that is planned to be removed
after removing legacy config processor.
2016-06-07 10:26:38 +02:00
Grzegorz Bizon 940763e0e7 Use CI config errors from new processor in legacy one 2016-06-06 20:56:58 +02:00
Grzegorz Bizon 251dd571df Extract CI config validation helpers to mixin 2016-06-06 11:05:15 +02:00
Grzegorz Bizon 23030439c2 Rename class that loads CI configuration to Loader 2016-06-06 08:20:55 +02:00
Grzegorz Bizon d501850e05 Add gitlab ci configuration class that holds hash
As for now, we keep this class inside a oryginal config processor class.
We will move implementation to this class and delegate to it from
current config processor.

After original gitlab ci yaml processor not longer has relevant
impelemntation we will replace it with new configuration class.
2016-06-03 14:20:34 +02:00
Grzegorz Bizon a55e8f109f Enable Style/NegatedIf Rubocop cop
Favor `unless` over `if` for negative conditions
(or control flow ||).

See #17478
2016-05-30 13:53:25 +02:00
Grzegorz Bizon 2c7439db4d Enable multiple compatible Rubocop cops
Closes #17406
2016-05-25 06:17:29 +02:00
Tomasz Maczukin 9a1b174d5c Fix some typos 2016-04-22 22:08:38 +02:00
Tomasz Maczukin a2e2989637 Modify code formatting 2016-04-22 22:08:37 +02:00
Tomasz Maczukin 0ccf629525 Simplify the GitlabCiYamlProcessor#initial_parsing method 2016-04-22 22:08:36 +02:00
Tomasz Maczukin 8dd27b47ea Add posibility to define a hidden job without 'script' in .gitlab-ci.yml 2016-04-22 22:08:34 +02:00
Kamil Trzcinski 3f66f4470a Make rubocop happy 2016-04-18 15:19:24 -04:00
Kamil Trzcinski 9a2685fae0 Merge branch 'after-script' into make-before-after-overridable 2016-04-18 10:20:51 -04:00
Kamil Trzcinski 0ce5cc9962 Resolve merge 2016-04-18 10:19:29 -04:00
Kamil Trzcinski 2ab8d3e652 Merge branch 'after-script' into make-before-after-overridable 2016-04-18 09:47:12 -04:00
Kamil Trzcinski aca1e14bd3 Merge remote-tracking branch 'origin/master' into after-script 2016-04-18 09:46:12 -04:00
Kamil Trzcinski 42102b4344 Merge branch 'after-script' into make-before-after-overridable 2016-04-18 07:53:21 -04:00
Kamil Trzcinski 63bd1f92d9 Fix rubocop complains 2016-04-18 07:51:49 -04:00
Grzegorz Bizon 1339fda1cd Minor refactorings in CI config 2016-04-18 13:36:52 +02:00
Grzegorz Bizon 2b1c08be8f Validate job-level variables in YAML config file 2016-04-18 13:17:48 +02:00
Grzegorz Bizon cf3e3effb0 Minor refactoring in code related to job variables 2016-04-18 13:17:48 +02:00
Grzegorz Bizon 1f3248644e Make CI config return empty array if no job variables 2016-04-18 13:17:48 +02:00
Grzegorz Bizon 3dec6e2629 Rename method that returns global envs in CI conf 2016-04-18 13:17:48 +02:00
Grzegorz Bizon b7946b50fc Read job variables directly from gitlab CI config 2016-04-18 13:17:48 +02:00
Grzegorz Bizon a1363d39c6 Add variables keyword to job in CI config YAML 2016-04-18 13:17:47 +02:00
Kamil Trzcinski 5a7e4dfd33 Merge branch 'after-script' into make-before-after-overridable
* after-script:
  Add CHANGELOG and documentation
  Rename finally_script to after_script

Conflicts:
	lib/ci/gitlab_ci_yaml_processor.rb
	spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
2016-04-17 09:06:55 -04:00
Kamil Trzcinski cc57d61023 Rename finally_script to after_script 2016-04-17 08:59:57 -04:00
Kamil Trzcinski 4cc9a02ee0 Allow the before_script and finally_script to be overwritten in context of job 2016-04-16 19:22:49 +02:00
Kamil Trzcinski b340b59743 Implement finally_script which allows to do cleanups as part of the build process 2016-04-16 19:22:48 +02:00
Kamil TrzcinskiandRémy Coutable 8fac12c590 Fix build dependencies, when the dependency is a string 2016-03-23 12:55:23 +01:00