私はウェブサイト(純粋なHTML + CSS)を変更してサーバーにデプロイしていました同じ。Capistrano 3:デプロイメントが "リフレッシュ"されていないコード(ウェブサイトはデプロイメント前の状態のままです)
私はサーバにログインし、ユニコーンを殺し、手動で起動し、新しいコンテンツがついに登場しました。
これを自動的に行うにはどうすればよいですか?
現在、私はこのdeploy.rb
セットアップを持っている:
# config valid only for current version of Capistrano
lock "3.8.1"
set :application, "project"
set :repo_url, "[email protected]:username/project.git"
set :branch, "master"
set :tmp_dir, '/home/deployer/tmp'
set :deploy_to, "/home/deployer/apps/project"
set :keep_releases, 5
set(:executable_config_files, %w(
unicorn_init.sh
))
# files which need to be symlinked to other parts of the
# filesystem. For example nginx virtualhosts, log rotation
# init scripts etc.
set(:symlinks, [
{
source: "nginx.conf",
link: "/etc/nginx/sites-enabled/default"
},
{
source: "unicorn_init.sh",
link: "/etc/init.d/unicorn_#{fetch(:application)}"
},
{
source: "log_rotation",
link: "/etc/logrotate.d/#{fetch(:application)}"
},
{
source: "monit",
link: "/etc/monit/conf.d/#{fetch(:application)}.conf"
}
])
namespace :deploy do
desc 'Restart application'
task :restart do
task :restart do
invoke 'unicorn:reload'
end
end
after :publishing, :restart
desc "Make sure local git is in sync with remote."
task :check_revision do
on roles(:web) do
unless `git rev-parse HEAD` == `git rev-parse origin/master`
puts "WARNING: HEAD is not the same as origin/master"
puts "Run `git push` to sync changes."
exit
end
end
end
before "deploy", "deploy:check_revision"
end
私は手動でサーバーを再起動する必要はありませんするために、まだ追加する必要がありますか?
あなたは
'task:restart do'の1つ余分なレベルを削除しようとしています。 –