Capistrano 3 does not deploy new code

I had this strange problem with Capistrano 3. The deployable code never updates unless I delete the repo folder in my application folder on the server. If I delete the repo folder and expand it, it will update the code.

# config valid only for Capistrano 3.1
lock '3.1.0'

set :application, 'APP_NAME'
set :repo_url, 'REPO'

# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }

# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/home/deployer/apps/APP_NAME'

# Default value for :scm is :git
set :scm, :git

set :branch, "master"

# Default value for :format is :pretty
set :format, :pretty

# Default value for :log_level is :debug
set :log_level, :info

# Default value for :pty is false
# set :pty, true

# Default value for :linked_files is []
# set :linked_files, %w{config/database.yml}

# Default value for linked_dirs is []
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }

# Default value for keep_releases is 5
# set :keep_releases, 5

set :use_sudo, false

set :linked_files, ["config/database.yml"]

namespace :deploy do
  desc "Start Unicorn"
  task :start do
    on roles(:app) do
      within current_path do
        execute :bundle, "exec unicorn_rails -c config/unicorn.rb -D"
      end
    end
  end

  desc "Stop Unicorn"
  task :stop do
    on roles(:app) do
      execute "kill -s QUIT `cat #{shared_path}/pids/unicorn.pid`"
    end
  end

  desc "Restart application"
  task :restart do
    invoke 'deploy:stop'
    invoke 'deploy:start'
  end
end
+4
source share
1 answer

Probably a little obvious, but did you check permissions on your server? I would try to grant full permissions to any user in the folder that I am trying to expand to check if it passes, if that happens, then you know where your problem is.

+2
source

Source: https://habr.com/ru/post/1534192/


All Articles