Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8312675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:14:29+00:00 2026-06-08T20:14:29+00:00

I have some basic issues with capistrano deployment. First of all, I need to

  • 0

I have some basic issues with capistrano deployment. First of all, I need to know whether capistrano is using git clone even for the second or third when the git repo is already existing. Is there any issue if it uses git pull? I have added set :deploy_via, :remote_cache in my capfile. I am asking this because I tried adding a new file in the path in the server, and not in the git repo as it was a server specific file. The next time I deployed using capistrano, the file disappeared. It seems like capistrano is using git clone even when a git repo is already created. Why cant capistrano use git pull to update the code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:14:30+00:00Added an answer on June 8, 2026 at 8:14 pm

    Capistrano creates a new subdirectory in realeases for each release like this

    horse:releases xxx$ ls -lart
    total 0
    drwxrwxr-x  22 xxx  staff  748 Jun 26 20:08 20120626180809
    drwxrwxr-x  22 xxx  staff  748 Jun 26 20:11 20120626181103
    drwxrwxr-x  22 xxx  staff  748 Jun 26 20:29 20120626182908
    drwxrwxr-x  22 xxx  staff  748 Jun 26 20:34 20120626183442
    drwxrwxr-x  22 xxx  staff  748 Jun 26 20:35 20120626183525
    drwxrwxr-x   8 xxx  staff  272 Jun 27 13:11 .
    drwxrwxr-x  22 xxx  staff  748 Jun 27 13:11 20120627111102
    drwxrwxr-x   5 xxx  staff  170 Jun 27 13:11 ..
    

    and then simply sets a symlink to the current release like this

    horse:deployed xxx$ ls -lart
    total 8
    drwxrwxr-x  4 xxx  staff  136 Jun 26 19:51 ..
    drwxrwxr-x  7 xxx  staff  238 Jun 26 20:22 shared
    drwxrwxr-x  8 xxx  staff  272 Jun 27 13:11 releases
    lrwxrwxr-x  1 xxx  staff   70 Jun 27 13:11 current -> /Users/xxx/RailsDeployment/server/deployed/releases/20120627111102
    

    This way, rollback of the deployment on the server is really easy as you just have to change the symlink back to the last (working) deployment, but as a new complete subdir is created each time it makes sense using git clone instead of git pull.

    If you want to have server-specific files, you have to add a capistrano deploy task to your config/deploy.rb file to copy it from somewhere else outside the app directory (typically the shared subfolder). The reason for this is that the deployment should be fully automatic and document all necessary steps in an automated procedure, and not depend on files on the server that were put there manually as this is the first step to a snowflake server. So, if you need a file that is not part of your git repository, as typically something containing production passwords, you need to change config/deploy.rb to copy this file to where you need it. To see how to do this look at the copy_db_credentials tasks in my deploy.rb:

    namespace :deploy do
      desc "cause Passenger to initiate a restart"
      task :restart do
        run "touch #{current_path}/tmp/restart.txt" 
      end
      desc "Copies database credentials"
      task :copy_db_credentials do
        run "cp #{shared_path}/credentials/database.yml #{current_path}/config/database.yml"
      end
    
      desc "reload the database with seed data"
      task :seed do
        run "cd #{current_path}; rake db:seed RAILS_ENV=#{rails_env}"
      end
    end
    after :deploy, "deploy:copy_db_credentials"
    after "deploy:update_code", :bundle_install
    desc "install the necessary prerequisites"
    task :bundle_install, :roles => :app do
      run "cd #{release_path} && bundle install"
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some basic questions around understanding fundamentals of Performance testing. I know that
I am having some issues doing basic math with Java. I don't know why
I have some basic jquery code sitting in the header of the header file
I have some basic PHP code: $raceramps56[short] = My Test Product; $leftMenu = '<div
I have some basic idea on how to do this task, but I'm not
I have some basic knowledge about web security that I have gained through years
I have some basic questions of calling a Fortran model from GAE. I uploaded
I have some basic (stupid) questions about AWS EC2 instances or AMIs. I created
I have some knowledge about Human computer interaction and some basic knowledge programming scripts
Lets say we have some basic AR model. class User < ActiveRecord::Base attr_accessible :firstname,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.