2016-08-24 12:49:21 +05:30
|
|
|
class Projects::PipelinesSettingsController < Projects::ApplicationController
|
|
|
|
before_action :authorize_admin_pipeline!
|
|
|
|
|
|
|
|
def show
|
2017-09-10 17:25:29 +05:30
|
|
|
redirect_to project_settings_ci_cd_path(@project, params: params)
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
if @project.update_attributes(update_params)
|
2017-09-10 17:25:29 +05:30
|
|
|
flash[:notice] = "Pipelines settings for '#{@project.name}' were successfully updated."
|
|
|
|
redirect_to project_settings_ci_cd_path(@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-09-10 17:25:29 +05:30
|
|
|
:public_builds, :auto_cancel_pending_pipelines, :ci_config_path
|
2016-08-24 12:49:21 +05:30
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|