2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
##
|
|
|
|
# Branch can be deleted either by DeleteBranchService
|
|
|
|
# or by GitPushService.
|
|
|
|
#
|
|
|
|
class AfterBranchDeleteService < BaseService
|
|
|
|
attr_reader :branch_name
|
|
|
|
|
|
|
|
def execute(branch_name)
|
|
|
|
@branch_name = branch_name
|
|
|
|
|
|
|
|
stop_environments
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def stop_environments
|
|
|
|
Ci::StopEnvironmentsService
|
|
|
|
.new(project, current_user)
|
|
|
|
.execute(branch_name)
|
|
|
|
end
|
|
|
|
end
|