简体   繁体   English

Capistrano 3没有部署新代码

[英]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. 我遇到了Capistrano 3这个奇怪的问题。除非我删除服务器上app文件夹中的repo文件夹,否则它所部署的代码永远不会更新。 If I delete the repo folder and deploy, it'll update the code. 如果我删除repo文件夹并进行部署,它将更新代码。

# 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

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. 我会尝试为我正在尝试部署的文件夹上的任何用户提供完全权限,只是作为测试,看看它是否通过,如果确实如此,那么你知道你的问题在哪里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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