Method: Gitlab::Client::Runners#register_runner

Defined in:
lib/gitlab/client/runners.rb

#register_runner(token, options = {}) ⇒ Gitlab::ObjectifiedHash

Register a new Runner for the instance.

Examples:

Gitlab.register_runner('9142c16ea169eaaea3d752313a434a6e')
Gitlab.register_runner('9142c16ea169eaaea3d752313a434a6e', description: 'Some Description', active: true, locked: false)

Parameters:

  • token(required) (String)

    Registration token.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :description(optional) (String)

    Runner description.

  • :info(optional) (Hash)

    Runner metadata.

  • :active(optional) (Boolean)

    Whether the Runner is active.

  • :locked(optional) (Boolean)

    Whether the Runner should be locked for current project.

  • :run_untagged(optional) (Boolean)

    Whether the Runner should handle untagged jobs.

  • :tag_list(optional) (Array<String>)

    List of Runner tags.

  • :maximum_timeout(optional) (Integer)

    Maximum timeout set when this Runner will handle the job.

Returns:



182
183
184
185
# File 'lib/gitlab/client/runners.rb', line 182

def register_runner(token, options = {})
  body = { token: token }.merge(options)
  post('/runners', body: body)
end