Facade entity which accumulates operations with currently running and db saved builds.
Create build by running given project.
params.projectName
- project to buildparams.withScmChangesOnly
- if true then build will be started only if there is scm changes for projectparams.queueQueued
- if true then currently queued project can be queued againparams.initiator
- contains information about initiator of the build, must containtype
property e.g. when one build triggers another: initiator: {type: 'build', id: 123, number: 10, project: {name: 'project1'}}params.buildParams
- params for current build (override project config)params.buildParams.scmRev
- target revision for the buildparams.env
- target environment for the build
result
will contain created builds
if they were created, every build
with at least following fields: id, status, completed, project, params,
createDate.
Cancel build by id. Queued or running build can be canceled.
params.buildId
- id of target build to cancelparams.canceledBy
- contains information about initiator of cancel, must containtype
property e.g. when canceled via http api: canceledBy: {type: 'httpApi'}
Get build by id.
Get log lines for the given build.
params.buildId
- target buildparams.from
- if set then lines from that number will be returnedparams.to
- if set then lines to that number will be returned
BuildsCollection.getAvgBuildDuration(builds:Array.)
Calculate average build duration for the given builds.
BuildsCollection.getRecent(params:Object, callback(err,builds):Function)
Get builds sorted by date in descending order.
params.projectName
- optional project filterparams.status
- optional status filter, can be used only whenparams.projectName
is set. When used builds in the result will contain only following fields: id, number, startDate, endDateparams.filter
- custom filter function which accepts build and returns booleanparams.limit
- maximum builds count to get
BuildsCollection.getDoneStreak(params:Object, callback(err,doneStreak):Function)
Get info about current done builds streak.
params.projectName
- optional project filter