Skip to content
Snippets Groups Projects
Commit 3ba825d4 authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Fix builds

parent b4ae9812
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -127,10 +127,10 @@ module Ci
end
end
 
def create_builds(ref, tag, user, trigger_request = nil)
def create_builds(user)
return unless config_processor
config_processor.stages.any? do |stage|
CreateBuildsService.new.execute(self, stage, ref, tag, user, trigger_request, 'success').present?
CreateBuildsService.new.execute(self, stage, user, 'success').present?
end
end
 
Loading
Loading
@@ -151,7 +151,7 @@ module Ci
 
# create builds for next stages based
next_stages.any? do |stage|
CreateBuildsService.new.execute(self, stage, build.ref, build.tag, build.user, build.trigger_request, status).present?
CreateBuildsService.new.execute(self, stage, build.user, status).present?
end
end
 
Loading
Loading
module Ci
class CreateBuildsService
def execute(commit, stage, ref, tag, user, trigger_request, status)
builds_attrs = commit.config_processor.builds_for_stage_and_ref(stage, ref, tag, trigger_request)
def execute(commit, stage, user, status)
builds_attrs = commit.config_processor.builds_for_stage_and_ref(stage, commit.ref, commit.tag)
 
# check when to create next build
builds_attrs = builds_attrs.select do |build_attrs|
Loading
Loading
@@ -17,7 +17,7 @@ module Ci
 
builds_attrs.map do |build_attrs|
# don't create the same build twice
unless commit.builds.find_by(ref: ref, tag: tag, trigger_request: trigger_request, name: build_attrs[:name])
unless commit.builds.find_by(ref: commit.ref, tag: commit.tag, name: build_attrs[:name])
build_attrs.slice!(:name,
:commands,
:tag_list,
Loading
Loading
@@ -27,9 +27,8 @@ module Ci
:stage_idx,
:plugin)
 
build_attrs.merge!(ref: ref,
tag: tag,
trigger_request: trigger_request,
build_attrs.merge!(ref: commit.ref,
tag: commit.tag,
user: user,
project: commit.project)
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment