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

stages_controller.rb « projects « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c8db5b1277fb0e6868e0ef02e811a1dcd4836e86 (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
# frozen_string_literal: true

class Projects::StagesController < Projects::PipelinesController
  before_action :authorize_update_pipeline!

  def play_manual
    ::Ci::PlayManualStageService
      .new(@project, current_user, pipeline: pipeline)
      .execute(stage)

    respond_to do |format|
      format.json do
        render json: StageSerializer
          .new(project: @project, current_user: @current_user)
          .represent(stage)
      end
    end
  end

  private

  def stage
    @pipeline_stage ||= pipeline.find_stage_by_name!(params[:stage_name])
  end
end