Created
August 21, 2010 18:17
-
-
Save kron4eg/542663 to your computer and use it in GitHub Desktop.
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
ENV['hosts'] = ['host1', 'host2', {:web => 'host3'}, {:app => 'host4'}] | |
def deploy | |
# will run on every host defined in ENV['hosts'], despite if it is in role | |
method_which_will_run_on_every_defined_host | |
run_once { run_tests } | |
web_role | |
app_role | |
end | |
def web_role | |
# will run only on :web hosts | |
return unless role? :web | |
copy_static | |
clear_cache | |
end | |
def app_role | |
# will run only on :app hosts | |
return unless role? :app | |
copy_code | |
run_migrate | |
end | |
def run_tests; end | |
def copy_static; end | |
def clear_cache; end | |
def copy_code; end | |
def run_migrate; end | |
def method_which_will_run_on_every_defined_host; end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ topor deploy