summaryrefslogtreecommitdiff
path: root/app/models/ci/build.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-14 14:44:09 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-14 14:44:09 +0200
commit6209b60c96d8b380ac184d83647c3c8b0b026cac (patch)
tree76c10929acdac040649188f85d289ab86a87205a /app/models/ci/build.rb
parentbb6f246790fb3a6b85ab2fd9341566557da64a23 (diff)
downloadgitlab-ce-6209b60c96d8b380ac184d83647c3c8b0b026cac.tar.gz
Properly create a new deployment after build success
Diffstat (limited to 'app/models/ci/build.rb')
-rw-r--r--app/models/ci/build.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 60202525727..9215ad36547 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -75,9 +75,13 @@ module Ci
build.execute_hooks
end
- after_transition any: :success do |build|
+ after_transition any => [:success] do |build|
if build.environment.present?
- CreateDeploymentService.new(build.project, build.user, environment: build.environment).execute(build)
+ service = CreateDeploymentService.new(build.project, build.user,
+ environment: build.environment,
+ sha: build.sha, ref: build.ref,
+ tag: build.tag)
+ service.execute(build)
end
end
end