Permalink
Browse files

expose PROCESS_ID

  • Loading branch information...
substack committed Mar 6, 2012
1 parent dcdfa59 commit 5192ca1bbf65351c7f41b42d1fa478f040f78222
Showing with 5 additions and 3 deletions.
  1. +3 −2 index.js
  2. +2 −1 test/command.js
View
@@ -348,6 +348,9 @@ Propagit.prototype.drone = function (fn) {
process.env.COMMIT = commit;
process.env.REPO = repo;
+ var id = Math.floor(Math.random() * (1<<24)).toString(16);
+ process.env.PROCESS_ID = id;
+
Object.keys(opts.env || {}).forEach(function (key) {
process.env[key] = opts.env[key];
});
@@ -358,8 +361,6 @@ Propagit.prototype.drone = function (fn) {
var cmd = opts.command[0];
var args = opts.command.slice(1);
- var id = Math.floor(Math.random() * (1<<24)).toString(16);
-
var processes = self.processes;
(function respawn () {
var ps = spawn(cmd, args, { cwd : dir });
View
@@ -101,7 +101,8 @@ test('command line deploy', function (t) {
t.equal(obj[0], 'beepity');
t.equal(obj[1].REPO, 'webapp');
t.ok(obj[1].COMMIT.match(/^[0-9a-f]{40}$/));
- t.ok(obj[1].PROPAGIT_BEEPITY, 'boop');
+ t.equal(obj[1].PROPAGIT_BEEPITY, 'boop');
+ t.ok(obj[1].PROCESS_ID.match(/^[0-9a-f]{6,}$/));
var droneId = obj[1].DRONE_ID;

0 comments on commit 5192ca1

Please sign in to comment.