Skip to content

Instantly share code, notes, and snippets.

@lusis
Created March 27, 2015 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lusis/a4bf7b206dd7c069ca09 to your computer and use it in GitHub Desktop.
Save lusis/a4bf7b206dd7c069ca09 to your computer and use it in GitHub Desktop.
snippet.coffee
robot.respond /rundeck (?:ad[ -]?hoc) ([\w -_]+) ([\w-]+)/i, (msg) ->
name = msg.match[1]
params = { argString: "-nodename #{msg.match[2].trim().toLowerCase()}" }
query = "?#{querystring.stringify(params)}"
robot.authorize msg, rundeck.adminRole, ->
rundeck.jobs().run name, query, (job, results) ->
if job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment