diff --git a/README.md b/README.md index 1bfad47..acd2c38 100644 --- a/README.md +++ b/README.md @@ -137,12 +137,21 @@ Programmatically: 'http://user:pass@host:port/path' ); + // trigger a standard build + nestor.buildJob('job', '', function (err, result) { + }); + // trigger a parameterised build - nestor.build('job', 'param1=value1¶m2=value2', function (err, result) { + nestor.buildJob('job', 'param1=value1¶m2=value2', function (err, result) { }); Check out [lib/jenkins](https://github.com/cliffano/nestor/blob/master/lib/jenkins.js) for other available methods. +Note: `` in the examples is a part of your Jenkins job URL after the first `job/`. + +For example, if you use nested folders on Jenkins and your URL is `/job/myproject/job/releases/job/master`, +then you should pass `myproject/job/releases/job/master` as ``. + Configuration ------------- ### Jenkins URL diff --git a/lib/api/job.js b/lib/api/job.js index 9ea33e3..afcacdf 100644 --- a/lib/api/job.js +++ b/lib/api/job.js @@ -89,7 +89,7 @@ function _delete(name, cb) { * Build a job. * * @param {String} name: Jenkins job name - * @param {Object} params: build parameters key-value pairs + * @param {Object|String} params: build parameters key-value pairs, passed as object or 'a=b&c=d' string * @param {Function} cb: standard cb(err, result) callback */ function build(name, params, cb) {