Forum: Ruby on Rails Configuring Capistrano For Local To Remote Deployment

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (Guest)
on 2006-05-14 04:16
(Received via mailing list)
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
C50f602386f3ebc77c2e339ce754d38e?d=identicon&s=25 Austin Godber (Guest)
on 2006-05-15 06:51
(Received via mailing list)
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.
C31c7255fa4488dfc5d766403b497a36?d=identicon&s=25 Jim Morris (wolfmanjm)
on 2006-05-15 06:57
(Received via mailing list)
I posted a recipe for doing this a while back...

http://www.nabble.com/a-switchtower-recipe-to-copy...

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
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (Guest)
on 2006-05-15 07:31
(Received via mailing list)
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
This topic is locked and can not be replied to.