-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathci.js
More file actions
74 lines (63 loc) · 1.75 KB
/
ci.js
File metadata and controls
74 lines (63 loc) · 1.75 KB
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
var queue = require('./queue'),
msbuild = require('msbuild'),
gitwin = require('gitwin');
var ci = function(verbose){
var verbose = true;
this.next = function(task){
queue.add(task);
}
this.start = function(){
queue.process();
}
this.init = function(config){
var verbose = false;
if(config){
if(config.verbose === false) {
verbose = false;
}
else{
verbose = true;
}
}
else{
console.log('');
console.log('error: configuration missing');
console.log('example');
var exampleConfig = {
configuration: 'your_app_configuration',
publishProfile: 'your_app_publish_profile',
sourcePath: 'c:/your_app_path/your_app.sln',
watchPath : 'c:/your_app_path'
};
console.log(JSON.stringify(exampleConfig));
console.log('');
}
var _write = function(action){
var prefixJson = '\n ';
console.log(' '+action+' '+prefixJson+'configuration:"'+config.configuration+ '",'+prefixJson+'publishProfile:"' +config.publishProfile+'",'+prefixJson+'sourcePath:"'+config.sourcePath+'"'+prefixJson+'');
}
var _publish = function(callback){
_write('publish');
var _msbuild = new msbuild(callback);
_msbuild.setConfig(config);
_msbuild.verbose = verbose;
_msbuild.publish();
};
var _build = function(callback){
_write('build');
var _msbuild = new msbuild(callback);
_msbuild.setConfig(config);
_msbuild.verbose = verbose;
_msbuild.build();
};
var _pull = function(callback){
_write('pull');
var _gitwin = new gitwin(callback);
_gitwin.path = (config.watchPath);
_gitwin.verbose = verbose;
_gitwin.pull();
};
return {build:_build,publish:_publish,pull:_pull};
};
}
module.exports = new ci();