debian-mirror-gitlab/app/controllers/projects/pipelines_settings_controller.rb

30 lines
852 B
Ruby
Raw Normal View History

2016-08-24 12:49:21 +05:30
class Projects::PipelinesSettingsController < Projects::ApplicationController
before_action :authorize_admin_pipeline!
def show
2017-08-17 22:00:37 +05:30
redirect_to namespace_project_settings_ci_cd_path(@project.namespace, @project, params: params)
2016-08-24 12:49:21 +05:30
end
def update
if @project.update_attributes(update_params)
flash[:notice] = "CI/CD Pipelines settings for '#{@project.name}' were successfully updated."
2017-08-17 22:00:37 +05:30
redirect_to namespace_project_settings_ci_cd_path(@project.namespace, @project)
2016-08-24 12:49:21 +05:30
else
2017-08-17 22:00:37 +05:30
render 'show'
2016-08-24 12:49:21 +05:30
end
end
private
def create_params
params.require(:pipeline).permit(:ref)
end
def update_params
params.require(:project).permit(
:runners_token, :builds_enabled, :build_allow_git_fetch, :build_timeout_in_minutes, :build_coverage_regex,
2017-08-17 22:00:37 +05:30
:public_builds, :auto_cancel_pending_pipelines
2016-08-24 12:49:21 +05:30
)
end
end