Skip to content

Instantly share code, notes, and snippets.

@kron4eg
Created August 21, 2010 18:17
Show Gist options
  • Save kron4eg/542663 to your computer and use it in GitHub Desktop.
Save kron4eg/542663 to your computer and use it in GitHub Desktop.
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
@kron4eg
Copy link
Author

kron4eg commented Aug 21, 2010

$ topor deploy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment