diff options
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 |