diff options
Diffstat (limited to 'app/controllers/groups/settings/ci_cd_controller.rb')
-rw-r--r-- | app/controllers/groups/settings/ci_cd_controller.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/app/controllers/groups/settings/ci_cd_controller.rb b/app/controllers/groups/settings/ci_cd_controller.rb index f476f428fdb..c465e622de0 100644 --- a/app/controllers/groups/settings/ci_cd_controller.rb +++ b/app/controllers/groups/settings/ci_cd_controller.rb @@ -13,7 +13,17 @@ module Groups def reset_registration_token @group.reset_runners_token! - flash[:notice] = 'New runners registration token has been generated!' + flash[:notice] = _('GroupSettings|New runners registration token has been generated!') + redirect_to group_settings_ci_cd_path + end + + def update_auto_devops + if auto_devops_service.execute + flash[:notice] = s_('GroupSettings|Auto DevOps pipeline was updated for the group') + else + flash[:alert] = s_("GroupSettings|There was a problem updating Auto DevOps pipeline: %{error_messages}." % { error_messages: group.errors.full_messages }) + end + redirect_to group_settings_ci_cd_path end @@ -29,6 +39,14 @@ module Groups def authorize_admin_group! return render_404 unless can?(current_user, :admin_group, group) end + + def auto_devops_params + params.require(:group).permit(:auto_devops_enabled) + end + + def auto_devops_service + Groups::AutoDevopsService.new(group, current_user, auto_devops_params) + end end end end |