Created
April 20, 2010 00:59
-
-
Save mipearson/371872 to your computer and use it in GitHub Desktop.
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
# this is a DSL example, anonymized from a production usecase, showing | |
# deployment to an A/B shared server system from multiple sources. | |
# note that in this example that while there are many servers to restart, | |
# the code is deployed to a shared drive. | |
application 'example' do | |
server_set = environment.example_test_server | |
cgi_bin_dir = environment.example_dir + '/cgi_bin' + server_set | |
web_dir = environment.example_dir + '/web' | |
# remove some paths in the destination | |
['doc', 'funcs-example', 'rw', 'templates'].each do |path| | |
rm_rf cgi_bin_dir + '/' + path | |
end | |
export 'example' do | |
# grab our helper and run some Example-specific transformations | |
example = helper(Example) | |
example.set_revision | |
example.compact_stylesheets | |
example.compact_templates | |
example.version_files | |
# discard some non-production code | |
['bin', 't', 'build', 'example.conf'].each do |path| | |
discard path | |
end | |
chown 'www' | |
deploy 'web', web_dir | |
deploy 'example', cgi_bin_dir | |
end | |
export 'example_sharedlib' do | |
chown 'www' | |
deploy 'lib', cgi_bin_dir + '/lib' | |
end | |
run environment.restart_command(server_set), :on => environment.example_servers(server_set) | |
notify :method => 'email', :to => environment.admin_email_address | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment