|
53 | 53 | }
|
54 | 54 |
|
55 | 55 | console.log('executing cmds before deploy');
|
56 |
| - execCmds(self.data.cmds_before_deploy, 0, function(){ |
| 56 | + execCmds(options.cmds_before_deploy, 0, function(){ |
57 | 57 | console.log('cmds before deploy executed');
|
58 | 58 |
|
59 | 59 |
|
60 |
| - var createFolder = 'cd ' + self.data.deploy_path + '/releases && mkdir ' + timeStamp; |
61 |
| - var removeCurrent = 'rm -rf ' + self.data.deploy_path + '/current'; |
62 |
| - var setCurrent = 'ln -s ' + self.data.deploy_path + '/releases/' + timeStamp + ' ' + self.data.deploy_path + '/current'; |
| 60 | + var createFolder = 'cd ' + options.deploy_path + '/releases && mkdir ' + timeStamp; |
| 61 | + var removeCurrent = 'rm -rf ' + options.deploy_path + '/current'; |
| 62 | + var setCurrent = 'ln -s ' + options.deploy_path + '/releases/' + timeStamp + ' ' + options.deploy_path + '/current'; |
63 | 63 |
|
64 | 64 | console.log('start deploy');
|
65 | 65 | exec(createFolder + ' && ' + removeCurrent + ' && ' + setCurrent,function(){
|
|
68 | 68 | var execLocal = require('child_process').exec;
|
69 | 69 | var child;
|
70 | 70 |
|
71 |
| - child = execLocal("scp -r . " + server.username + "@" + server.host + ":" + self.data.deploy_path + "/releases/" + timeStamp, function (error, stdout, stderr) { |
| 71 | + child = execLocal("scp -r . " + server.username + "@" + server.host + ":" + options.deploy_path + "/releases/" + timeStamp, function (error, stdout, stderr) { |
72 | 72 | console.log('end deploy');
|
73 | 73 |
|
74 | 74 | console.log('executing cmds after deploy');
|
75 |
| - execCmds(self.data.cmds_after_deploy, 0, function(){ |
| 75 | + execCmds(options.cmds_after_deploy, 0, function(){ |
76 | 76 | console.log('cmds after deploy executed');
|
77 | 77 | connection.end();
|
78 | 78 | });
|
|
81 | 81 | })
|
82 | 82 | }
|
83 | 83 |
|
84 |
| - var length = self.data.servers.length; |
| 84 | + var length = options.servers.length; |
85 | 85 | var completed = 0;
|
86 | 86 | var checkCompleted = function(){
|
87 | 87 | completed++;
|
|
90 | 90 | }
|
91 | 91 | }
|
92 | 92 |
|
93 |
| - self.data.servers.forEach(function(server){ |
| 93 | + options.servers.forEach(function(server){ |
94 | 94 | var c = new Connection();
|
95 | 95 | c.on('connect', function() {
|
96 | 96 | console.log('Connecting to server: ' + server.host);
|
|
0 commit comments