Conrad Taylor
2006-May-14 02:14 UTC
[Rails] Configuring Capistrano For Local To Remote Deployment
How does one configure capistrano for moving local file to your remote server? In the docs it says that one cannot use file:// so what''s the configuration step for resolving this issue? Thanks in advance, -Conrad -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060514/93bb7173/attachment-0001.html
Austin Godber
2006-May-15 04:51 UTC
[Rails] Configuring Capistrano For Local To Remote Deployment
Conrad Taylor wrote:> How does one configure capistrano for moving local file to your remote > server? In the docs it says that one cannot use file:// so what''s the > configuration step for resolving this issue?Assuming your local machine (where your svn repo lives and you are running rake deploy) is linux and the machine has SSH enabled. I don''t see any reason you cant use the svn+ssh URI to access your local SVN repository. You can typically access any file:/// URI svn repo by using the svn+ssh://localhost/path/to/svn URI. (NOTE: this probably won''t work if your local machine is not a live internet host, it will depend on where the svn checkout is performed ... probably on the target servers, thus your local computer would have to be accessible by the target servers via the URI provided. So sitting in a coffee shop working on your laptop wont cut it.) So I would suggest you set that as your :repository in your deploy.rb. Let me know if this works.
Jim Morris
2006-May-15 04:55 UTC
[Rails] Configuring Capistrano For Local To Remote Deployment
I posted a recipe for doing this a while back... http://www.nabble.com/a-switchtower-recipe-to-copy-rather-than-checkout-t1187330.html#a3127795 Here are the basic details... desc "fix up database and .htaccess" task :after_update_code do run "cp #{release_path}/config/database.yml.templ #{release_path}/config/database.yml" run "cp #{release_path}/public/dot.htaccess.deploy #{release_path}/public/.htaccess" end desc <<DESC Update all servers with the latest release of the source code. This is a modified version that copies a local copy to the remote site DESC task :update_code, :roles => [:app, :db, :web] do on_rollback { delete release_path, :recursive => true } #puts "doing my update_code" temp_dest= "tmp_code" #puts "...get a local copy of the code into #{temp_dest} from local svn" # but this could also just be your local development folder system("svn export -q #{configuration.repository} #{temp_dest}") #puts "...tar the folder" # you could exclude files here that you don''t want on your production server system("tar -C #{temp_dest} -c -z -f code_update.tar.gz .") #puts "...Sending tar file to remote server" put(File.read("code_update.tar.gz"), "code_update.tar.gz") #puts "...detar code on server" run <<-CMD mkdir -p #{release_path} && tar -C #{release_path} -x -z -f code_update.tar.gz && rm -rf code_update.tar.gz && rm -rf #{release_path}/log #{release_path}/public/system && ln -nfs #{shared_path}/log #{release_path}/log && ln -nfs #{shared_path}/system #{release_path}/public/system CMD #puts "...cleanup" system("rm -rf #{temp_dest} code_update.tar.gz") end Conrad Taylor wrote:> How does one configure capistrano for moving local file to your remote > server? In the docs it says that one cannot use file:// so what''s the > configuration step for resolving this issue? > > Thanks in advance, > > -Conrad > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Conrad Taylor
2006-May-15 05:26 UTC
[Rails] Configuring Capistrano For Local To Remote Deployment
Hi ALL, thanks for responding to my post. I''ll experiment with both to see if it works for me. BTW, I''m working on a Mac OS X. Gotta go and thanks again. Peace, -Conrad On 5/14/06, Jim Morris <morris@wolfman.com> wrote:> I posted a recipe for doing this a while back... > > http://www.nabble.com/a-switchtower-recipe-to-copy-rather-than-checkout-t1187330.html#a3127795 > > Here are the basic details... > > desc "fix up database and .htaccess" > task :after_update_code do > run "cp #{release_path}/config/database.yml.templ #{release_path}/config/database.yml" > run "cp #{release_path}/public/dot.htaccess.deploy #{release_path}/public/.htaccess" > end > > desc <<DESC > Update all servers with the latest release of the source code. > This is a modified version that copies a local copy to the remote site > DESC > > task :update_code, :roles => [:app, :db, :web] do > on_rollback { delete release_path, :recursive => true } > > #puts "doing my update_code" > temp_dest= "tmp_code" > > #puts "...get a local copy of the code into #{temp_dest} from local svn" > # but this could also just be your local development folder > system("svn export -q #{configuration.repository} #{temp_dest}") > > #puts "...tar the folder" > # you could exclude files here that you don''t want on your production server > system("tar -C #{temp_dest} -c -z -f code_update.tar.gz .") > > #puts "...Sending tar file to remote server" > put(File.read("code_update.tar.gz"), "code_update.tar.gz") > > #puts "...detar code on server" > run <<-CMD > mkdir -p #{release_path} && > tar -C #{release_path} -x -z -f code_update.tar.gz && > rm -rf code_update.tar.gz && > rm -rf #{release_path}/log #{release_path}/public/system && > ln -nfs #{shared_path}/log #{release_path}/log && > ln -nfs #{shared_path}/system #{release_path}/public/system > CMD > > #puts "...cleanup" > system("rm -rf #{temp_dest} code_update.tar.gz") > end > > > > > Conrad Taylor wrote: > > How does one configure capistrano for moving local file to your remote > > server? In the docs it says that one cannot use file:// so what''s the > > configuration step for resolving this issue? > > > > Thanks in advance, > > > > -Conrad > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >