Module: Gitlab::Client::BuildTriggers

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/build_triggers.rb

Overview

Defines methods related to builds.

Instance Method Summary collapse

Instance Method Details

#create_trigger(project) ⇒ Gitlab::ObjectifiedHash

Create a build trigger for a project.

Examples:

Gitlab.create_trigger(5)

Parameters:

  • project (Integer)

    The ID of a project.

Returns:



35
36
37
# File 'lib/gitlab/client/build_triggers.rb', line 35

def create_trigger(project)
  post("/projects/#{project}/triggers")
end

#remove_trigger(project, token) ⇒ Gitlab::ObjectifiedHash

Remove a project's build trigger.

Examples:

Gitlab.remove_trigger(5, '7b9148c158980bbd9bcea92c17522d')

Parameters:

  • project (Integer)

    The ID of a project.

  • token (String)

    The token of a trigger.

Returns:



47
48
49
# File 'lib/gitlab/client/build_triggers.rb', line 47

def remove_trigger(project, token)
  delete("/projects/#{project}/triggers/#{token}")
end

#trigger(project, token) ⇒ Gitlab::ObjectifiedHash

Gets details of project's build trigger.

Examples:

Gitlab.trigger(5, '7b9148c158980bbd9bcea92c17522d')

Parameters:

  • project (Integer)

    The ID of a project.

  • token (String)

    The token of a trigger.

Returns:



24
25
26
# File 'lib/gitlab/client/build_triggers.rb', line 24

def trigger(project, token)
  get("/projects/#{project}/triggers/#{token}")
end

#triggers(project) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of the project's build triggers

Examples:

Gitlab.triggers(5)

Parameters:

  • project (Integer)

    The ID of a project.

Returns:



12
13
14
# File 'lib/gitlab/client/build_triggers.rb', line 12

def triggers(project)
  get("/projects/#{project}/triggers")
end