Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-06-06 10:47:06 +0300
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-06-06 10:47:06 +0300
commita93e34acc3e52ccf81369d3345faaa48fee08581 (patch)
tree8760de571c961b9f6ab8b629429f2a274cca4ac2 /lib
parenteaa8836b1d7264391e0b51c1e4d7c7b873f76a43 (diff)
parent46317b7dabd585bed42cf9c0008a7c69c080d33f (diff)
Merge branch '25045-add-variables-to-post-pipeline-api' into 'master'
Resolve "POST api/v4/projects/:id/pipeline should accept variables" Closes #25045 See merge request gitlab-org/gitlab-ce!19124
Diffstat (limited to 'lib')
-rw-r--r--lib/api/pipelines.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb
index 735591fedd5..8374a57edfa 100644
--- a/lib/api/pipelines.rb
+++ b/lib/api/pipelines.rb
@@ -41,15 +41,20 @@ module API
end
params do
requires :ref, type: String, desc: 'Reference'
+ optional :variables, Array, desc: 'Array of variables available in the pipeline'
end
post ':id/pipeline' do
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42124')
authorize! :create_pipeline, user_project
+ pipeline_params = declared_params(include_missing: false)
+ .merge(variables_attributes: params[:variables])
+ .except(:variables)
+
new_pipeline = Ci::CreatePipelineService.new(user_project,
current_user,
- declared_params(include_missing: false))
+ pipeline_params)
.execute(:api, ignore_skip_ci: true, save_on_errors: false)
if new_pipeline.persisted?