Ich habe einige Änderungen auf der Website (reines HTML + CSS), es auf dem Server bereitgestellt und nach der Aktualisierung des Browsers war der Inhalt das Gleiche.Capistrano 3: Nach der Bereitstellung ist nicht "refreshed" Code (Website bleibt wie vorher die Bereitstellung)
Also habe ich mich am Server angemeldet, Einhorn getötet, manuell gestartet und der neue Inhalt ist endlich erschienen.
Wie mache ich das automatisch?
Derzeit habe ich diese deploy.rb
Setup:
# 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
Was muss ich hinzufügen, noch um nicht tun müssen, um manuell Server neu starten?
Danke
Versuchen Sie, eine zusätzliche Ebene von "Aufgabe: Neustart tun" zu löschen –