4
我有Capistrano 3的這個奇怪的問題。它部署的代碼永遠不會更新,除非我刪除我的應用程序文件夾中的服務器上的repo文件夾。如果我刪除repo文件夾並進行部署,它將更新代碼。Capistrano 3沒有部署新代碼
# 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
嗨,你可以在運行'cap#{stage} deploy'時粘貼你的'config/deploy /#{stage} .rb'文件和日誌嗎? – ifyouseewendy
我只是有定義的角色和他們的地址。 –