This repository was archived by the owner on Jan 28, 2026. It is now read-only.
Add callbacks to deployment events, refresh#176
Closed
intjonathan wants to merge 20 commits into
Closed
Conversation
relistan
reviewed
Jan 25, 2017
relistan
left a comment
Collaborator
There was a problem hiding this comment.
Nice @intjonathan, this looks ready to 🚢
relistan
previously approved these changes
Jan 25, 2017
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.
It's containers, not images, that start and stop. Also, between stopping and starting containers it can be useful to muck with the environment on a per-host basis, so add a before_starting_container hook.
48f53bf to
4789be5
Compare
intjonathan
commented
Mar 22, 2017
| super server, service, timeout | ||
| end | ||
|
|
||
| def before_starting_container(server, service) |
Contributor
Author
There was a problem hiding this comment.
I'm not certain this actually gets called.
| end | ||
|
|
||
| def callbacks | ||
| fetch 'callbacks', Hash.new { [] } |
Contributor
Author
There was a problem hiding this comment.
Currently this fails with:
NoMethodError: undefined method `fetch' for Centurion::DeployCallbacks:Module
/Users/intjonathan/sites/centurion/lib/centurion/deploy_callbacks.rb:38:in `callbacks'
/Users/intjonathan/sites/centurion/lib/centurion/deploy_callbacks.rb:32:in `emit'
/Users/intjonathan/sites/centurion/lib/centurion/deploy_callbacks.rb:11:in `before_starting_container'
/Users/intjonathan/sites/centurion/lib/tasks/deploy.rake:143:in `block (3 levels) in <top (required)>'
/Users/intjonathan/sites/centurion/lib/centurion/deploy_dsl.rb:8:in `call'
/Users/intjonathan/sites/centurion/lib/centurion/deploy_dsl.rb:8:in `block (2 levels) in on_each_docker_host'
I'm not sure how it was supposed to work given the history - @relistan any ideas?
Collaborator
There was a problem hiding this comment.
Well the idea had been to keep fetch and other env methods out of that code entirely and to have the required data passed in instead. I'd need to spend some more time looking at this code to see what the right thing is to do there.
Member
|
We're archiving the project, so I'm closing all open PRs: |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This resolves merge conflicts in #124 in preparation for merge in 1.9.