Read about our upcoming Code of Conduct on this issue

This instance was upgraded to Heptapod 0.28.0 today

runner_projects_controller.rb 657 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Projects::RunnerProjectsController < Projects::ApplicationController
  before_action :authorize_admin_project!

  layout 'project_settings'

  def create
    @runner = Ci::Runner.find(params[:runner_project][:runner_id])

    return head(403) unless current_user.ci_authorized_runners.include?(@runner)

    path = runners_path(project)

    if @runner.assign_to(project, current_user)
      redirect_to path
    else
      redirect_to path, alert: 'Failed adding runner to project'
    end
  end

  def destroy
21
    runner_project = project.runner_projects.find(params[:id])
22
23
24
25
26
    runner_project.destroy

    redirect_to runners_path(project)
  end
end