lib/railsmachine/recipes.rb in railsmachine-0.1.0 vs lib/railsmachine/recipes.rb in railsmachine-0.1.1

- old
+ new

@@ -8,10 +8,11 @@ desc "Setup servers." task :setup_servers do setup_db setup_app + setup_symlinks setup_web end desc "Setup application server." task :setup_app, :roles => :app do @@ -36,11 +37,11 @@ stop_mongrel_cluster end desc "Setup web server." task :setup_web, :roles => :web do - set :apache_server_name, domain + set :apache_server_name, domain unless apache_server_name configure_apache end desc "Restart web server." task :restart_web, :roles => :web do @@ -71,10 +72,24 @@ task :setup_scm, :roles => :scm do setup_svn import_svn end + desc "Setup public symlink directories" + task :setup_symlinks, :roles => [:app, :web] do + if app_symlinks + app_symlinks.each { |link| run "mkdir -p #{shared_path}/public/#{link}" } + end + end + + desc "Link up any public directories." + task :symlink_public, :roles => [:app, :web] do + if app_symlinks + app_symlinks.each { |link| run "ln -nfs #{shared_path}/public/#{link} #{current_path}/public/#{link}" } + end + end + desc <<-DESC Restart the processes on the application server by calling restart_app. DESC task :restart, :roles => :app do restart_app @@ -85,20 +100,11 @@ DESC task :spinner, :roles => :app do start_app end - desc "Link up any directories." - task :after_symlink, :roles => :app do - if app_symlinks - app_symlinks.each { |link| run "ln -nfs #{shared_path}/public/#{link} #{current_path}/public/#{link}" } - end - end - - desc "Setup symlink dirs" - task :after_setup, :roles => :app do - if app_symlinks - app_symlinks.each { |link| run "mkdir #{shared_path}/#{link}" } - end + desc "Creates additional symlinks." + task :after_symlink, :roles => [:app, :web] do + symlink_public end end