summaryrefslogtreecommitdiff
path: root/app/services/projects/update_service.rb
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2017-11-17 17:24:40 +0100
committerEric Eastwood <contact@ericeastwood.com>2017-11-28 12:42:08 -0600
commita4a389a0a7314d011275592474bd974924f86735 (patch)
tree3469be680f8e0cf5931cb54fa784a86389e43d0f /app/services/projects/update_service.rb
parenta7f6ab952acc58e7ef9a33fba3fbaaa0918572fe (diff)
downloadgitlab-ce-a4a389a0a7314d011275592474bd974924f86735.tar.gz
BE for automatic pipeline when enabling Auto DevOps
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/38962
Diffstat (limited to 'app/services/projects/update_service.rb')
-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]