Skip to content

Commit

Permalink
Adding a hubot script to configure environments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Umang Chouhan committed Sep 27, 2013
1 parent 1cdd3a8 commit 6b8d50b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions chef.coffee
Expand Up @@ -46,3 +46,15 @@ module.exports = (robot) ->
msg.send error
msg.send stdout
msg.send stderr

robot.respond /configure environment (.*)$/i, (msg) ->
environment = msg.match[1]
@exec = require('child_process').exec
command = "knife ssh -x config --ssh-user root --no-color chef_environment:#{environment} 'sudo chef-client'"

msg.send "Configuring #{server}."

@exec command, (error, stdout, stderr) ->
msg.send error
msg.send stdout
msg.send stderr

0 comments on commit 6b8d50b

Please sign in to comment.