Skip to content

Instantly share code, notes, and snippets.

@Mmmkayness
Created May 28, 2013 10:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Mmmkayness/5661854 to your computer and use it in GitHub Desktop.
Save Mmmkayness/5661854 to your computer and use it in GitHub Desktop.
# Description:
# Executes a taskDeploy command for spinning up task instances
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_DEPLOY_SCRIPT_LOCATION
# HUBOT_DEPLOY_USER
# HUBOT_DEPLOY_KEY
#
# Commands:
# hubot taskDeploy <appname>, <branchname>
#
# Author:
# adam
{spawn} = require 'child_process'
module.exports = (robot) ->
robot.respond /taskDeploy (.*?)(, (.*))/i, (msg) ->
scriptLocation = process.env.HUBOT_DEPLOY_SCRIPT_LOCATION
awsUser = process.env.HUBOT_DEPLOY_USER
awsKey = process.env.HUBOT_DEPLOY_KEY
appName = msg.match[1]
branchName = msg.match[3]
output = spawn scriptLocation, [ '-a', appName, '-b', branchName, '-u', awsUser, '-k', awsKey ]
output.stdout.on 'data', (data) ->
msg.send data.toString()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment