Stream the output of a Jenkins build
$ npm install --save jenkins-log-stream
var JenkinsLogStream = require('jenkins-log-sream');
var stream = new JenkinsLogStream({
'baseUrl': 'http://user:pass@jenkins.server:8080',
'job': 'jenkins-job',
'build': 'lastBuild',
'pollInterval': 1000
});
stream.pipe(process.stdout);
baseUrl
The Jenkins base URL, including the username and password, and also the port if it is not 80. Required.job
The name of the Jenkins job. Required.build
The id of the build, a numeric value or'lastBuild'
for the last build. Defaults to'lastBuild'
.pollInterval
Integer to specify how often to poll the Jenkins server, in milliseconds. Defaults to 1000, i.e. one second.
MIT @ R consortium