简体   繁体   中英

Deploying Rails app with Capistrano 3 with git repository on the same server

I am deploying to a server using Capistrano v3. I have git repository on the same server I am deploying to.

In Capistrano v2 I had this:

set :scm, :git
set :repository,  "/home/myuser/repos/myrepo.git"
set :local_repository, "file://."
set :branch, 'master'
set :deploy_via, :remote_cache

set :deploy_to, "/var/www/apps/myapp"
server 'myserver.com', :app, :web, :primary => true

How to do this with Capistrano v3 ?

My site on my home computer is also a git repository synchronized with the git repository on the server.

Since the newer version, Capistrano 3, there have been a bunch of minute changes. (Fairly typical is what I'm finding out now in the RoR world).

You use repo_url instead of repository.

So in your deploy.rb, try replacing

     set :repository, "git@github.com:username/appname.git"  # Your clone URL

with

     set :repo_url, "git@github.com:username/appname.git"  # Your clone URL

Hopefully this works! It worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM