2016-07-20 08:33:13 -04:00
|
|
|
class Projects::PipelinesSettingsController < Projects::ApplicationController
|
|
|
|
before_action :authorize_admin_pipeline!
|
|
|
|
|
|
|
|
def show
|
2017-06-29 13:06:35 -04:00
|
|
|
redirect_to project_settings_ci_cd_path(@project, params: params)
|
2016-07-20 08:33:13 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
2017-08-30 14:39:23 -04:00
|
|
|
if @project.update(update_params)
|
2017-05-11 15:10:11 -04:00
|
|
|
flash[:notice] = "Pipelines settings for '#{@project.name}' were successfully updated."
|
2017-06-29 13:06:35 -04:00
|
|
|
redirect_to project_settings_ci_cd_path(@project)
|
2016-07-20 08:33:13 -04:00
|
|
|
else
|
2016-11-22 10:12:47 -05:00
|
|
|
render 'show'
|
2016-07-20 08:33:13 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def update_params
|
|
|
|
params.require(:project).permit(
|
2017-08-30 14:39:23 -04:00
|
|
|
:runners_token, :builds_enabled, :build_allow_git_fetch,
|
|
|
|
:build_timeout_in_minutes, :build_coverage_regex, :public_builds,
|
|
|
|
:auto_cancel_pending_pipelines, :ci_config_path,
|
|
|
|
auto_devops_attributes: [:id, :domain, :enabled]
|
2016-07-20 08:33:13 -04:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|