Permalink
Browse files

fixed 0.8 and runCmd issues

  • Loading branch information...
1 parent e9c839a commit 72ca529e713e3a8d8c27dfe9e08c1393a68a2d53 @substack committed Jul 28, 2012
Showing with 11 additions and 20 deletions.
  1. +1 −1 .travis.yml
  2. +8 −8 index.js
  3. +2 −2 package.json
  4. +0 −9 test/command.js
View
@@ -1,4 +1,4 @@
language: node_js
node_js:
- - 0.4
- 0.6
+ - 0.8
View
@@ -271,8 +271,12 @@ Propagit.prototype.drone = function (fn) {
function refs (repo) {
return {
- origin : (self.gitUri + '/' + repo).replace(/(\.git)*$/, '.git'),
- repodir : path.join(self.repodir, repo + '.git'),
+ origin : (self.gitUri + '/' + repo)
+ .replace(/(\.git)*$/, '.git')
+ ,
+ repodir : path.join(self.repodir, repo + '.git')
+ .replace(/(\.git)*$/, '.git')
+ ,
}
}
self.on('error', self.emit.bind(self, 'error'));
@@ -281,12 +285,8 @@ Propagit.prototype.drone = function (fn) {
actions.fetch = function (repo, cb) {
var p = refs(repo);
-console.log('FETCH ' + p.repodir);
- runCmd([ 'git', 'init', '--bare', p.repodir ], function (err) {
+ runCmd([ 'git', 'init', p.repodir ], function (err) {
if (err) return cb(err);
-
-console.log('+ ' + p.origin);
-console.dir(fs.readdirSync(p.repodir));
runCmd([ 'git', 'fetch', p.origin ], { cwd : p.repodir }, cb);
});
};
@@ -513,7 +513,7 @@ function runCmd (cmd, opts, cb) {
opts = {};
}
- var ps = spawn(cmd[0], cmd.slice(1));
+ var ps = spawn(cmd[0], cmd.slice(1), opts);
var data = '';
ps.stdout.on('data', function (buf) { data += buf });
ps.stderr.on('data', function (buf) { data += buf });
View
@@ -1,7 +1,7 @@
{
"name" : "propagit",
"description" : "cascading multi-server git deployment",
- "version" : "0.5.4",
+ "version" : "0.5.5",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/propagit.git"
@@ -26,7 +26,7 @@
},
"dependencies" : {
"optimist" : "~0.3.4",
- "upnode" : "~0.2.4",
+ "upnode" : "~0.3.1",
"pushover" : "~0.1.4",
"mkdirp" : "~0.3.3"
},
View
@@ -30,15 +30,11 @@ test('command line deploy', function (t) {
cmd, [ 'hub', '--port=' + port, '--secret=beepboop' ],
{ cwd : dirs.hub }
);
- ps.hub.stdout.pipe(process.stdout, { end : false });
- ps.hub.stderr.pipe(process.stderr, { end : false });
ps.drone = spawn(
cmd, [ 'drone', '--hub=localhost:' + port, '--secret=beepboop' ],
{ cwd : dirs.drone }
);
- ps.drone.stdout.pipe(process.stdout, { end : false });
- ps.drone.stderr.pipe(process.stderr, { end : false });
setTimeout(function () {
var opts = { cwd : dirs.repo };
@@ -79,14 +75,11 @@ test('command line deploy', function (t) {
'deploy', '--hub=localhost:' + port, '--secret=beepboop',
'webapp', commit
]);
- ps.deploy.stderr.pipe(process.stdout, { end : false });
- ps.deploy.stdout.pipe(process.stderr, { end : false });
ps.deploy.on('exit', run.bind(null, commit));
}
function run (commit) {
-console.log('run!');
ps.run = spawn(cmd, [
'spawn', '--hub=localhost:' + port, '--secret=beepboop',
'--env.PROPAGIT_BEEPITY=boop',
@@ -99,7 +92,6 @@ console.log('run!');
function testServer () {
var opts = { host : 'localhost', port : httpPort, path : '/' };
http.get(opts, function (res) {
-console.log('get!');
var data = '';
res.on('data', function (buf) { data += buf });
res.on('end', function () {
@@ -122,7 +114,6 @@ console.log('get!');
}
function readPs (p, droneId) {
-console.log('readPs!');
var json = '';
p.stdout.on('data', function (buf) { json += buf });
p.stdout.on('end', function () {

0 comments on commit 72ca529

Please sign in to comment.