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
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2019-07-29 10:43:10 +0300
committerPhil Hughes <me@iamphill.com>2019-07-29 10:43:10 +0300
commita5aa40c5fe93dc3daba8a578f4c09c4e443fcbec (patch)
tree34eb74d209b1919f78ce70d89ee0900cd2602780 /app/controllers/projects/jobs_controller.rb
parent946f7c0687760ec49aca582a329d0ec3c7ac3037 (diff)
Add Job specific variables
Adds Job specific variables to facilitate specifying variables when running manual jobs.
Diffstat (limited to 'app/controllers/projects/jobs_controller.rb')
-rw-r--r--app/controllers/projects/jobs_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb
index 02ff6e872c9..adbc0159358 100644
--- a/app/controllers/projects/jobs_controller.rb
+++ b/app/controllers/projects/jobs_controller.rb
@@ -94,7 +94,7 @@ class Projects::JobsController < Projects::ApplicationController
def play
return respond_422 unless @build.playable?
- build = @build.play(current_user)
+ build = @build.play(current_user, play_params[:job_variables_attributes])
redirect_to build_path(build)
end
@@ -190,6 +190,10 @@ class Projects::JobsController < Projects::ApplicationController
{ query: { 'response-content-type' => 'text/plain; charset=utf-8', 'response-content-disposition' => 'inline' } }
end
+ def play_params
+ params.permit(job_variables_attributes: %i[key secret_value])
+ end
+
def trace_artifact_file
@trace_artifact_file ||= build.job_artifacts_trace&.file
end