Method: Gitlab::Client::PipelineTriggers#run_trigger

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

#run_trigger(project, token, ref, variables = {}) ⇒ Gitlab::ObjectifiedHash

Run the given project pipeline trigger.

Examples:

Gitlab.run_trigger(5, '7b9148c158980bbd9bcea92c17522d', 'master')
Gitlab.run_trigger(5, '7b9148c158980bbd9bcea92c17522d', 'master', { variable1: "value", variable2: "value2" })

Parameters:

  • project (Integer, String)

    The ID or name of the project.

  • token (String)

    The token of a trigger.

  • ref (String)

    Branch or tag name to build.

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

    A set of build variables to use for the build. (optional)

Returns:

See Also:

[View source]

95
96
97
98
99
100
101
# File 'lib/gitlab/client/pipeline_triggers.rb', line 95

def run_trigger(project, token, ref, variables = {})
  post("/projects/#{url_encode project}/trigger/pipeline", unauthenticated: true, body: {
         token: token,
         ref: ref,
         variables: variables
       })
end