nci/docs/developing-plugins/builds-collection.md
2016-01-09 22:23:39 +03:00

1.9 KiB

BuildsCollection()

Facade entity which accumulates operations with currently running and db saved builds.

BuildsCollection.create(params:Object, [callback(err)]:Function)

Create build by running given project.

  • params.projectName - project to build
  • params.withScmChangesOnly - if true then build will be started only if there is scm changes for project
  • params.queueQueued - if true then currently queued project can be queued again
  • params.initiator - contains information about initiator of the build, must contain type property e.g. when one build triggers another: initiator: {type: 'build', id: 123, number: 10, project: {name: 'project1'}

BuildsCollection.cancel(id:Number, [callback(err)]:Function)

Cancel build by id. Note that only queued build can be canceled currently.

BuildsCollection.get(id:Number, callback(err,build):Function)

Get build by id.

BuildsCollection.getLogLines(params:Object, callback(err,logLinesData):Function)

Get log lines for the given build.

  • params.buildId - target build
  • params.from - if set then lines from that number will be returned
  • params.to - if set then lines to that number will be returned

BuildsCollection.getAvgBuildDuration(builds:Array.