diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-15 15:06:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-15 15:06:06 +0300 |
commit | fc96671f817239041ba2747af835a8d5d9aa3739 (patch) | |
tree | 19c7f650c869033760850b0d0edd4fb0a10968c4 /app/services | |
parent | 3d13802bc2c9400ea33defdd43bff6d904ee9c4d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/ci/retry_build_service.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/services/ci/retry_build_service.rb b/app/services/ci/retry_build_service.rb index 338495ba030..7a5e33c61ba 100644 --- a/app/services/ci/retry_build_service.rb +++ b/app/services/ci/retry_build_service.rb @@ -39,9 +39,18 @@ module Ci .where(name: build.name) .update_all(retried: true) - project.builds.create!(Hash[attributes]) + create_build!(attributes) end end # rubocop: enable CodeReuse/ActiveRecord + + private + + def create_build!(attributes) + build = project.builds.new(Hash[attributes]) + build.deployment = ::Gitlab::Ci::Pipeline::Seed::Deployment.new(build).to_resource + build.save! + build + end end end |