Created
September 16, 2014 18:47
-
-
Save deleteme/c75a8056ea6e2ca4015c to your computer and use it in GitHub Desktop.
A proof of concept for deploying in two phases
This file contains hidden or 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
Q = require 'q' | |
exec = Q.denodify require('child_process').exec | |
nodes = for i in [1..10] | |
-> exec "deploy.sh -n=#{ i }" | |
makeDeploySet = (start, end) | |
-> | |
set = (deploy() for deploy in nodes[start..end]) | |
$.when.apply null, set | |
postToSlack = (message)-> | |
msg.send message | |
deployA = makeDeploySet 0, 5 | |
deployB = makeDeploySet 6, 10 | |
deploy = deployA().then -> deployB() | |
deploy.fin postToSlack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment