Welcome to mirror list, hosted at ThFree Co, Russian Federation.

play_manual_stage_service.rb « ci « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c6fa7803e5271e4aa028f11e512ff16737191e94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

module Ci
  class PlayManualStageService < BaseService
    def initialize(project, current_user, params)
      super

      @pipeline = params[:pipeline]
    end

    def execute(stage)
      stage.processables.manual.each do |processable|
        next unless processable.playable?

        processable.play(current_user)
      rescue Gitlab::Access::AccessDeniedError
        logger.error(message: 'Unable to play manual action', processable_id: processable.id)
      end
    end

    private

    attr_reader :pipeline, :current_user

    def logger
      Gitlab::AppLogger
    end
  end
end