Add callbacks to deployment events#124
Conversation
|
I'll check this out next week. I think @kremso's solution of using rake task dependencies is probably the better solution, but I'm not going to judge until I've spent some time looking at what you've contributed. Thanks! :) |
|
I actually got some time this afternoon to look at this. This looks very good. The API is probably cleaner to use than the rake DSL, as well. I feel like callbacks are a slippery slope to the mess that is Capistrano. But there is an undeniable need to use them. @kremso @didip @jessedearing any feedback? |
|
The code is clean and tested, I like it. |
We need to tell our load balancers about these two events. We can provide callbacks that allow us to do so.
Since prepend is a Ruby 2.0 thing, there is probably a better way to get this functionality without sprinkling all the callbacks into deploy.
This should let the callbacks have a chance to execute first and call up to the deploy module at the proper time.
My initial approach used some Ruby 2.0 features. I thought it would be good to ensure backwards compatibility to older Rubies.
8621c38 to
f0ef65f
Compare
|
I rebased the feature to keep it up to date with current master. I've already added comments in ready. |
|
I think that this is simple enough after all, and covers all our use cases. |
|
I like the interface. It's pretty clean and simple. For any sort of callback mechanism I prefer a generalized event emitter pattern for callbacks. That being said I think this good to merge. |
|
This is a little better now. There is still some commonality that could come out. |
|
@MarkBorcherding any chance you could rebase this bad boy? |
|
I'm so far removed from using Docker, and it's fallen too far behind. |
|
No worries, thanks for checking in. |
|
Supplanted by #176 |
We need to tell our load balancer that our image is about to go down and to stop routing traffic to it. Similarly, we need to tell it when it comes back up and is ready for traffic again.
This adds the following callbacks to the task DSL
@kremso has some ideas on how to implement this differently, that may be more elegant in the end, but I think this approach is less intrusive to the existing code.