Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capistrano 3 is not deploying new code

I'm having this weird problem with Capistrano 3. The code it deploys is never updated, unless I delete the repo folder in my app folder on the server. If I delete the repo folder and deploy, it'll 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
like image 985
Chris Bui Avatar asked Oct 20 '22 11:10

Chris Bui


1 Answers

Probably a little obvious but did you check the permissions on your server? I would try giving full permissions to any user on the folder I'm trying to deploy to just as a test to see if it goes through, if it does then you know where your problem is.

like image 151
eduardosasso Avatar answered Oct 23 '22 02:10

eduardosasso