summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-11-28 20:09:27 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2017-11-28 20:09:27 +0000
commit99d143fb2e67b1015166d54cb6cac5c197355a10 (patch)
tree3928aee24c6b8a36c77e321398ea93c7d9db7955 /app/services
parent1ce27c7d78f0833985ef82b0018064d3c821b9fe (diff)
parentac87bd0c113e5265d7913e13c005850a4f6bf4c3 (diff)
downloadgitlab-ce-99d143fb2e67b1015166d54cb6cac5c197355a10.tar.gz
Merge branch '38962-automatically-run-a-pipeline-when-auto-devops-is-turned-on-in-project-settings' into 'master'
Add checkbox to automatically run a pipeline when Auto DevOps is turned on in project settings Closes #38962 See merge request gitlab-org/gitlab-ce!15380
Diffstat (limited to 'app/services')
-rw-r--r--app/services/projects/update_service.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/services/projects/update_service.rb b/app/services/projects/update_service.rb
index 13e292a18bf..72eecc61c96 100644
--- a/app/services/projects/update_service.rb
+++ b/app/services/projects/update_service.rb
@@ -15,7 +15,7 @@ module Projects
return error("Could not set the default branch") unless project.change_head(params[:default_branch])
end
- if project.update_attributes(params.except(:default_branch))
+ if project.update_attributes(update_params)
if project.previous_changes.include?('path')
project.rename_repo
else
@@ -31,8 +31,16 @@ module Projects
end
end
+ def run_auto_devops_pipeline?
+ params.dig(:run_auto_devops_pipeline_explicit) == 'true' || params.dig(:run_auto_devops_pipeline_implicit) == 'true'
+ end
+
private
+ def update_params
+ params.except(:default_branch, :run_auto_devops_pipeline_explicit, :run_auto_devops_pipeline_implicit)
+ end
+
def renaming_project_with_container_registry_tags?
new_path = params[:path]