gpt4 book ai didi

ruby-on-rails - Capistrano 3 没有部署新代码

转载 作者:行者123 更新时间:2023-12-04 20:43:04 26 4
gpt4 key购买 nike

我在使用 Capistrano 3 时遇到了这个奇怪的问题。它部署的代码永远不会更新,除非我删除服务器上应用程序文件夹中的 repo 文件夹。如果我删除 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

最佳答案

可能有点明显,但是您是否检查了服务器上的权限?我会尝试向我尝试部署的文件夹上的任何用户授予完全权限,作为测试,看看它是否通过,如果通过,那么您就知道问题出在哪里。

关于ruby-on-rails - Capistrano 3 没有部署新代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22754704/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com