1.2.5 • Published 5 years ago
node-jenkins v1.2.5
node-jenkins
Usage
Create an instance
Options
- jenkinsId:
String
usually the email you use to log into your jenkins. - jenkinsToken:
String
you can find it in your jenkins personal area. - jenkinsPath:
String
the url you use to acces to your jenkins. - customHeaders:
Object
default={}
with custom headers to be sended in every request (don't worry about the 'Authorization' or 'crumb' headers, node-jenkins do it for you :wink: ).
import Jenkins from "node-jenkins";
const jenkins = new Jenkins(jenkinsId, jenkinsToken, jenkinsPath, [
customHeaders
]);
Info
Retrieve server information.
const info = await jenkins.info();
Jobs
Retrieve job information
- jobName:
String
job url
const info = await jenkins.info(jobName);
Retrieve job configuration
- jobUrl:
String
job url
const config = await jenkins.getJobConfig(jobUrl);
Builds
Retrieve build information
- jobName:
String
job url - jobId:
Number
build id
const info = await jenkins.getBuildInfo(jobName, jobId);
Trigger build with parameters
- jobName:
String
job url - params:
Object
default={}
params to send to job building
const build = await jenkins.buildWithParams(jobName, [params]);
Trigger build now
- jobName:
String
job url
const build = await jenkins.build(jobName);
Show progressive console output
- jobName:
String
job url - jobId:
Number
build id - showLogs:
Boolean
default=true
you can execute this function without displaying logs on console, only to waiting for the build finish - interval:
Number
default=100
interval to retrieve next output in milliseconds
await jenkins.progressiveText(jobName, jobId, [showLogs, interval]);
Note that in all examples i use async
/await
, you can use .then
instead
License
This work is licensed under the MIT License (see the LICENSE file).
1.2.5
5 years ago
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.6
6 years ago
1.1.5
6 years ago
1.1.4
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago
0.2.0
6 years ago
0.1.7
6 years ago
0.1.6
6 years ago
0.1.5
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago