forked from moul/node-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectBuilds.coffee
More file actions
26 lines (19 loc) · 846 Bytes
/
Copy pathProjectBuilds.coffee
File metadata and controls
26 lines (19 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
BaseModel = require '../BaseModel'
Utils = require '../Utils'
class ProjectBuilds extends BaseModel
# === Builds
listBuilds: (projectId, params={}, fn = null) =>
if 'function' is typeof params
fn = params
params={}
params.page ?= 1
params.per_page ?= 100
@debug "Projects::listBuilds()"
@get "projects/#{Utils.parseProjectId projectId}/builds", params, (data) => fn data if fn
showBuild: (projectId, buildId, fn = null) =>
@debug "Projects::build()"
@get "projects/#{Utils.parseProjectId projectId}/builds/#{buildId}", null, (data) => fn data if fn
triggerBuild: (params={}, fn = null) =>
@debug "Projects::triggerBuild()"
@post "projects/#{Utils.parseProjectId params.projectId}/trigger/builds", params, (data) -> fn data if fn
module.exports = (client) -> new ProjectBuilds client