diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-06-12 13:16:54 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-06-12 13:59:37 +0300 |
commit | dc28749419635cf20b1a62a839186adf0640697c (patch) | |
tree | 702060acfb8a0953728f501bc4f12dce16f8a6d7 /app/models/commit.rb | |
parent | e744d06515eb4195115d451b744009aa4dd24d1f (diff) | |
download | gitlab-ci-dc28749419635cf20b1a62a839186adf0640697c.tar.gz |
New syntax of gitlab-ci.yml
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 |