2016-10-13 06:58:25 -04:00
|
|
|
class BuildSuccessWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2017-08-21 08:16:51 -04:00
|
|
|
include PipelineQueue
|
|
|
|
|
|
|
|
enqueue_in group: :processing
|
2016-10-13 06:58:25 -04:00
|
|
|
|
|
|
|
def perform(build_id)
|
|
|
|
Ci::Build.find_by(id: build_id).try do |build|
|
2016-11-17 06:08:28 -05:00
|
|
|
create_deployment(build) if build.has_environment?
|
2016-10-13 06:58:25 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2016-10-13 09:24:33 -04:00
|
|
|
def create_deployment(build)
|
2017-06-01 09:01:32 -04:00
|
|
|
CreateDeploymentService.new(build).execute
|
2016-10-13 06:58:25 -04:00
|
|
|
end
|
|
|
|
end
|