diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /lib/gitlab/ci/pipeline/seed/build.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'lib/gitlab/ci/pipeline/seed/build.rb')
-rw-r--r-- | lib/gitlab/ci/pipeline/seed/build.rb | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/lib/gitlab/ci/pipeline/seed/build.rb b/lib/gitlab/ci/pipeline/seed/build.rb index 5a0ad695741..901208f325a 100644 --- a/lib/gitlab/ci/pipeline/seed/build.rb +++ b/lib/gitlab/ci/pipeline/seed/build.rb @@ -79,9 +79,7 @@ module Gitlab def to_resource strong_memoize(:resource) do - processable = initialize_processable - assign_resource_group(processable) unless @pipeline.create_deployment_in_separate_transaction? - processable + initialize_processable end end @@ -89,39 +87,10 @@ module Gitlab if bridge? ::Ci::Bridge.new(attributes) else - ::Ci::Build.new(attributes).tap do |build| - unless @pipeline.create_deployment_in_separate_transaction? - build.assign_attributes(self.class.deployment_attributes_for(build)) - end - end + ::Ci::Build.new(attributes) end end - def assign_resource_group(processable) - processable.resource_group = - Seed::Processable::ResourceGroup.new(processable, @resource_group_key) - .to_resource - end - - def self.deployment_attributes_for(build, environment = nil) - return {} unless build.has_environment? - - environment = Seed::Environment.new(build).to_resource if environment.nil? - - unless environment.persisted? - return { status: :failed, failure_reason: :environment_creation_failure } - end - - build.persisted_environment = environment - - { - deployment: Seed::Deployment.new(build, environment).to_resource, - metadata_attributes: { - expanded_environment_name: environment.name - } - } - end - private delegate :logger, to: :@context |