Skip to content

Commit

Permalink
Preventing multiple deploys when auto-deploying.
Browse files Browse the repository at this point in the history
  • Loading branch information
Umang Chouhan committed Jun 12, 2012
1 parent 59e6170 commit ac30820
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions wd.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ module.exports = (robot) ->
@target = 'megatron'
@command = @application + ':' + @target

msg.send 'Deploying ' + @application + ' to ' + @target
unless robot.brain.deploying
msg.send 'Deploying ' + @application + ' to ' + @target

@exec 'cd ' + process.env.HUBOT_WD_PATH + ' && wd deploy --to=' + @command, (error, stdout, stderr) ->
msg.send 'Standard Output: ' + stdout
msg.send 'Standard Error: ' + stderr
msg.send 'Error: ' + error if error != null
robot.brain.data.deploying = true
@exec 'cd ' + process.env.HUBOT_WD_PATH + ' && wd deploy --to=' + @command, (error, stdout, stderr) ->
msg.send 'Standard Output: ' + stdout
msg.send 'Standard Error: ' + stderr
msg.send 'Error: ' + error if error != null
robot.brain.data.deploying = false

robot.hear /deploy ([\w .-]+):([\w .-]+)$/i, (msg) ->
@exec = require('child_process').exec
Expand Down

0 comments on commit ac30820

Please sign in to comment.