Class: Projects::RunnersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/projects/runners_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#redirect_back_or_default

Methods included from PageLayoutHelper

#blank_container, #container_class, #fluid_layout, #header_title, #nav, #page_card_attributes, #page_card_meta_tags, #page_description, #page_image, #page_title, #sidebar

Methods included from GitlabRoutingHelper

#activity_project_path, #edit_project_path, #edit_project_url, #issue_path, #issue_url, #merge_request_path, #merge_request_url, #milestone_path, #project_builds_path, #project_commits_path, #project_files_path, #project_path, #project_pipelines_path, #project_snippet_url, #project_url, #runner_path, #runners_path, #toggle_subscription_path

Methods included from Gitlab::GonHelper

#add_gon_variables

Methods included from Gitlab::CurrentSettings

#current_application_settings, #fake_application_settings

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Projects::ApplicationController

Instance Method Details

#destroyObject


27
28
29
30
31
32
33
# File 'app/controllers/projects/runners_controller.rb', line 27

def destroy
  if @runner.only_for?(project)
    @runner.destroy
  end

  redirect_to runners_path(@project)
end

#editObject


16
17
# File 'app/controllers/projects/runners_controller.rb', line 16

def edit
end

#indexObject


7
8
9
10
11
12
13
14
# File 'app/controllers/projects/runners_controller.rb', line 7

def index
  @runners = project.runners.ordered
  @specific_runners = current_user.ci_authorized_runners.
    where.not(id: project.runners).
    ordered.page(params[:page]).per(20)
  @shared_runners = Ci::Runner.shared.active
  @shared_runners_count = @shared_runners.count(:all)
end

#pauseObject


43
44
45
46
47
48
49
# File 'app/controllers/projects/runners_controller.rb', line 43

def pause
  if @runner.update_attributes(active: false)
    redirect_to runner_path(@runner), notice: 'Runner was successfully updated.'
  else
    redirect_to runner_path(@runner), alert: 'Runner was not updated.'
  end
end

#resumeObject


35
36
37
38
39
40
41
# File 'app/controllers/projects/runners_controller.rb', line 35

def resume
  if @runner.update_attributes(active: true)
    redirect_to runner_path(@runner), notice: 'Runner was successfully updated.'
  else
    redirect_to runner_path(@runner), alert: 'Runner was not updated.'
  end
end

#showObject


51
52
# File 'app/controllers/projects/runners_controller.rb', line 51

def show
end

#toggle_shared_runnersObject


54
55
56
57
58
# File 'app/controllers/projects/runners_controller.rb', line 54

def toggle_shared_runners
  project.toggle!(:shared_runners_enabled)

  redirect_to namespace_project_runners_path(project.namespace, project)
end

#updateObject


19
20
21
22
23
24
25
# File 'app/controllers/projects/runners_controller.rb', line 19

def update
  if @runner.update_attributes(runner_params)
    redirect_to runner_path(@runner), notice: 'Runner was successfully updated.'
  else
    redirect_to runner_path(@runner), alert: 'Runner was not updated.'
  end
end