diff options
| author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-03-12 10:15:33 +0000 |
|---|---|---|
| committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2019-03-12 10:15:33 +0000 |
| commit | 7e9348f3594ee158dfd4aaa9e03e5bb5dd36aead (patch) | |
| tree | 74e03ba375331ab619a766d5d2a3c12aaa267095 /app/controllers/groups/settings | |
| parent | db37b5a4c8d408e1bce0843162c609dcb1781188 (diff) | |
| download | gitlab-ce-7e9348f3594ee158dfd4aaa9e03e5bb5dd36aead.tar.gz | |
Enable/disable Auto DevOps at Group level
- Includes instance methods on Group model to detect when a group has
AutoDevOps explicitly/implicitly enabled/disabled.
- Includes migration to add a new column to namespaces table
- Add UI necessary modifications
- Add service and controller to update auto devops
related instances
- Updates project and groups auto devops badges
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52447
Diffstat (limited to 'app/controllers/groups/settings')
| -rw-r--r-- | app/controllers/groups/settings/ci_cd_controller.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/groups/settings/ci_cd_controller.rb b/app/controllers/groups/settings/ci_cd_controller.rb index f476f428fdb..f378f7ac79a 100644 --- a/app/controllers/groups/settings/ci_cd_controller.rb +++ b/app/controllers/groups/settings/ci_cd_controller.rb @@ -17,6 +17,16 @@ module Groups 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 + private def define_ci_variables @@ -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 |
