diff options
author | Valery Sizov <valery@gitlab.com> | 2015-06-12 15:05:01 +0000 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2015-06-12 15:05:01 +0000 |
commit | 83940de53b7d66be5496c69d20eb834607696897 (patch) | |
tree | d05871619e2906d2acc26d83b5a4f8eb1f07da37 /app/models/commit.rb | |
parent | 1a80d6973073f33fd77b7d556d66f81abfe22e62 (diff) | |
parent | f70fa3eb45104304a1ea5a33edb0ea8bea3f0d32 (diff) | |
download | gitlab-ci-83940de53b7d66be5496c69d20eb834607696897.tar.gz |
Merge branch 'new_syntax' into 'master'
New syntax of .gitlab-ci.yml
See merge request !136
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 3bc38b6..f27a385 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -92,11 +92,15 @@ class Commit < ActiveRecord::Base end def create_builds - filter_param = tag? ? :tags : :branches - config_processor.builds.each do |build_attrs| - if build_attrs[filter_param] - builds.create!({ project: project }.merge(build_attrs.extract!(:name, :commands, :tag_list))) - end + return if push_data[:commits].last[:message] =~ /(\[ci skip\])/ + + config_processor.builds_for_ref(ref, tag).each do |build_attrs| + builds.create!({ + project: project, + name: build_attrs[:name], + commands: build_attrs[:script], + tag_list: build_attrs[:tags] + }) end end @@ -115,8 +119,16 @@ class Commit < ActiveRecord::Base end def create_deploy_builds - config_processor.deploy_builds_for_ref(ref).each do |build_attrs| - builds.create!({ project: project }.merge(build_attrs)) + return if push_data[:commits].last[:message] =~ /(\[ci skip\])/ + + config_processor.deploy_builds_for_ref(ref, tag).each do |build_attrs| + builds.create!({ + project: project, + name: build_attrs[:name], + commands: build_attrs[:script], + tag_list: build_attrs[:tags], + deploy: true + }) end end |