debian-mirror-gitlab/app/controllers/concerns/runner_setup_scripts.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
569 B
Ruby
Raw Normal View History

2021-01-03 14:25:43 +05:30
# frozen_string_literal: true
module RunnerSetupScripts
extend ActiveSupport::Concern
private
2021-04-29 21:17:54 +05:30
def private_runner_setup_scripts
instructions = Gitlab::Ci::RunnerInstructions.new(os: script_params[:os], arch: script_params[:arch])
2021-01-03 14:25:43 +05:30
output = {
install: instructions.install_script,
register: instructions.register_command
}
if instructions.errors.any?
render json: { errors: instructions.errors }, status: :bad_request
else
render json: output
end
end
def script_params
params.permit(:os, :arch)
end
end