forked from jansepar/node-jenkins-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testjenkinsapi.js
90 lines (75 loc) · 2.06 KB
/
testjenkinsapi.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/**
* This is my poor excuse of a test file. One day, I will write some unit tests.
* Until then, this is all I have :)
*/
var jenkinsapi = require('./lib/main');
var jenkins = jenkinsapi.init("http://localhost:8080");
/*
jenkins.build('test', function(error, data) {
if (error) {
console.log(error);
}
console.log(data);
});
*/
/*
var view_name = "test";
jenkins.all_jobs_in_view(view_name, function (error, data) {
if (error) {
console.log(error);
}
console.log(data);
});
*/
/*
jenkins.all_jobs(function(error, data) { console.log(data)});
*/
/*
jenkins.job_info('test-madness', function(error, data) {
if(!error) {
console.log(data);
}
});
*/
/*
jenkins.job_info('test', function(error, data) {
if (!error) {
console.log(data);
}
});
*/
//jenkins.last_build_info('test-development', function(error, data) { console.log(data); });
//jenkins.last_build_report('test-development', function(error, data) { console.log(data); });
/*
jenkins.get_config_xml('test-development', function(error, data) {
//console.log(data);
jenkins.create_job('test-copy', data, function(error, data) {
//console.log(data);
});
});
*/
/*
jenkins.copy_job('test-development'
,'test-new'
,function(data) {
return data.replace('development','feature-branch');
}
,function(error, data) {
//console.log(data);
jenkins.delete_job('test-new', function(error, data) {
if(error) {
console.log("error!");
}
console.log(data);
});
});
*/
/*
jenkins.delete_job('test-new', function(error, data) {
if(error) {
console.log("error!");
console.log(data.body, data.statusCode);
*/
//jenkins.computers(function(error, data) { console.log(data)});
//jenkins.queue(function(error, data) { console.log(data)});
jenkins.build