2018-07-05 10:18:17 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-22 17:01:48 +00:00
|
|
|
# Branch can be deleted either by DeleteBranchService or by Git::BranchPushService.
|
2016-11-11 09:33:16 +00:00
|
|
|
class AfterBranchDeleteService < BaseService
|
|
|
|
attr_reader :branch_name
|
|
|
|
|
|
|
|
def execute(branch_name)
|
|
|
|
@branch_name = branch_name
|
|
|
|
|
|
|
|
stop_environments
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def stop_environments
|
2016-11-14 12:57:09 +00:00
|
|
|
Ci::StopEnvironmentsService
|
2016-11-11 09:33:16 +00:00
|
|
|
.new(project, current_user)
|
|
|
|
.execute(branch_name)
|
|
|
|
end
|
|
|
|
end
|