debian-mirror-gitlab/app/controllers/groups/settings/ci_cd_controller.rb

35 lines
906 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
2017-09-10 17:25:29 +05:30
module Groups
module Settings
class CiCdController < Groups::ApplicationController
2018-03-27 19:54:05 +05:30
skip_cross_project_access_check :show
2017-09-10 17:25:29 +05:30
before_action :authorize_admin_pipeline!
def show
define_secret_variables
end
2018-12-05 23:21:45 +05:30
def reset_registration_token
@group.reset_runners_token!
flash[:notice] = 'New runners registration token has been generated!'
redirect_to group_settings_ci_cd_path
end
2017-09-10 17:25:29 +05:30
private
def define_secret_variables
@variable = Ci::GroupVariable.new(group: group)
.present(current_user: current_user)
@variables = group.variables.order_key_asc
.map { |variable| variable.present(current_user: current_user) }
end
def authorize_admin_pipeline!
return render_404 unless can?(current_user, :admin_pipeline, group)
end
end
end
end