Created
March 28, 2014 13:49
-
-
Save otsuarez/9833225 to your computer and use it in GitHub Desktop.
pipeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### new-package.coffee | |
``` | |
# Description: | |
# watch for new artifacts and triggers deployment | |
# | |
# Dependencies: | |
# None | |
# | |
# Commands: | |
# hubot new_artifact_available < artifact > < env > | |
# | |
# Author: | |
# osvaldo | |
exec = require('child_process').exec; | |
module.exports = (robot)-> | |
robot.hear /new_artifact: ([\.a-z0-9\-\_]+)(\s+)?(.*)?/i, (msg) -> | |
artifact = msg.match[1] | |
env = msg.match[3] | |
env ?= "prod" | |
server = "server1" | |
script="ssh "+server+" /usr/local/bin/ansible/deploy-pkg.sh "+artifact+" "+env | |
child = exec script, (error,stdout,stderr) -> | |
console.log("deploying "+artifact+"\n") | |
msg.send "creating and deploying native packages for "+artifact | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment