diff options
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/ci/create_builds_service.rb | 39 | ||||
-rw-r--r-- | app/services/ci/web_hook_service.rb | 2 |
2 files changed, 18 insertions, 23 deletions
diff --git a/app/services/ci/create_builds_service.rb b/app/services/ci/create_builds_service.rb index 77a4305071c..255fdc41103 100644 --- a/app/services/ci/create_builds_service.rb +++ b/app/services/ci/create_builds_service.rb @@ -1,26 +1,23 @@ module Ci class CreateBuildsService - def execute(commit, ref, tag, user, config_processor, trigger_request) - config_processor.stages.any? do |stage| - builds_attrs = config_processor.builds_for_stage_and_ref(stage, ref, tag) - builds_attrs.map do |build_attrs| - # don't create the same build twice - unless commit.builds.find_by_name_and_trigger_request(name: build_attrs[:name], ref: ref, tag: tag, trigger_request: trigger_request) - commit.builds.create!({ - name: build_attrs[:name], - commands: build_attrs[:script], - tag_list: build_attrs[:tags], - options: build_attrs[:options], - allow_failure: build_attrs[:allow_failure], - stage: build_attrs[:stage], - stage_idx: build_attrs[:stage_idx], - trigger_request: trigger_request, - ref: ref, - tag: tag, - user: user, - }) - end - end + def execute(commit, stage, ref, tag, user, trigger_request) + builds_attrs = commit.config_processor.builds_for_stage_and_ref(stage, ref, tag) + + builds_attrs.map do |build_attrs| + build_attrs.slice!(:name, + :commands, + :tag_list, + :options, + :allow_failure, + :stage, + :stage_idx) + + build_attrs.merge!(ref: ref, + tag: tag, + trigger_request: trigger_request, + user: user) + + commit.builds.create!(build_attrs) end end end diff --git a/app/services/ci/web_hook_service.rb b/app/services/ci/web_hook_service.rb index 87984b20fa1..4bbca5c7da1 100644 --- a/app/services/ci/web_hook_service.rb +++ b/app/services/ci/web_hook_service.rb @@ -28,8 +28,6 @@ module Ci gitlab_url: project.gitlab_url, ref: build.ref, sha: build.sha, - before_sha: build.before_sha, - push_data: build.commit.push_data }) end end |