Remove Capistrano.
No longer used now that we use Kubernetes to deploy the site instead of Capistrano. If you run your own installation of Danbooru, and you used Capistrano to deploy your site, it is recommended that you switch to either the Docker Compose file (for personal installs), the Procfile (for non-Dockerized, development environments), or Kubernetes (for production environments; see https://github.com/danbooru/danbooru-infrastructure/tree/master/k8s for Danbooru's production configuration).
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
namespace :app do
|
||||
set :rolling_deploy, false
|
||||
|
||||
task :disable do
|
||||
if fetch(:rolling_deploy)
|
||||
# do nothing
|
||||
else
|
||||
invoke "web:disable"
|
||||
invoke "unicorn:stop"
|
||||
end
|
||||
end
|
||||
|
||||
task :enable do
|
||||
if fetch(:rolling_deploy)
|
||||
invoke "unicorn:legacy_restart"
|
||||
else
|
||||
invoke "unicorn:start"
|
||||
invoke "web:enable"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
namespace :deploy do
|
||||
desc "Deploy a rolling update without taking the site down for maintenance"
|
||||
task :rolling do
|
||||
set :rolling_deploy, true
|
||||
invoke "deploy"
|
||||
end
|
||||
end
|
||||
|
||||
before "deploy:migrate", "app:disable"
|
||||
after "deploy:published", "app:enable"
|
||||
|
||||
before "app:disable", "delayed_job:stop"
|
||||
after "app:enable", "delayed_job:start"
|
||||
@@ -1,39 +0,0 @@
|
||||
namespace :delayed_job do
|
||||
desc "Start delayed_job process"
|
||||
task :start do
|
||||
on roles(:worker) do
|
||||
within current_path do
|
||||
with rails_env: fetch(:rails_env) do
|
||||
bundle = SSHKit.config.command_map[:bundle]
|
||||
|
||||
execute :"systemd-run", "--user --collect --slice delayed_job --unit delayed_job.bulk_update -E RAILS_ENV=$RAILS_ENV -p WorkingDirectory=$PWD -p Restart=always #{bundle} exec bin/delayed_job --queues=bulk_update run"
|
||||
fetch(:delayed_job_workers, 16).times do |n|
|
||||
execute :"systemd-run", "--user --collect --slice delayed_job --unit delayed_job.#{n} -E RAILS_ENV=$RAILS_ENV -p WorkingDirectory=$PWD -p Restart=always #{bundle} exec bin/delayed_job --queues=default run"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc "Stop delayed_job process"
|
||||
task :stop do
|
||||
on roles(:worker) do
|
||||
execute :systemctl, "--user stop delayed_job.slice"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Restart delayed_job process"
|
||||
task :restart do
|
||||
on roles(:worker) do
|
||||
execute :systemctl, "--user restart delayed_job.slice"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Show status of delayed_job process"
|
||||
task :status do
|
||||
on roles(:worker) do
|
||||
# systemctl exits with status 3 if the service isn't running.
|
||||
execute :systemctl, "--user status delayed_job.slice", raise_on_non_zero_exit: false
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,28 +0,0 @@
|
||||
namespace :nginx do
|
||||
desc "Shut down Nginx"
|
||||
task :stop do
|
||||
on roles(:web) do
|
||||
as :user => "root" do
|
||||
execute "/etc/init.d/nginx", "stop"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc "Start Nginx"
|
||||
task :start do
|
||||
on roles(:web) do
|
||||
as :user => "root" do
|
||||
execute "/etc/init.d/nginx", "start"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc "Reload Nginx"
|
||||
task :reload do
|
||||
on roles(:web) do
|
||||
as :user => "root" do
|
||||
execute "/etc/init.d/nginx", "reload"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,19 +0,0 @@
|
||||
namespace :symlink do
|
||||
desc "Link the local config files"
|
||||
task :local_files do
|
||||
on roles(:app, :worker) do
|
||||
execute :ln, "-s", "#{deploy_to}/shared/config/danbooru_local_config.rb", "#{release_path}/config/danbooru_local_config.rb"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Link the local directories"
|
||||
task :directories do
|
||||
on roles(:app, :worker) do
|
||||
execute :rm, "-f", "#{release_path}/public/data"
|
||||
execute :ln, "-s", "#{deploy_to}/shared/data", "#{release_path}/public/data"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
after "deploy:symlink:shared", "symlink:local_files"
|
||||
after "deploy:symlink:shared", "symlink:directories"
|
||||
@@ -1,21 +0,0 @@
|
||||
namespace :web do
|
||||
desc "Present a maintenance page to visitors."
|
||||
task :disable do
|
||||
on roles(:app) do
|
||||
maintenance_html_path = "#{current_path}/public/maintenance.html.bak"
|
||||
if test("[ -e #{maintenance_html_path} ]")
|
||||
execute :mv, maintenance_html_path, "#{current_path}/public/maintenance.html"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc "Makes the application web-accessible again."
|
||||
task :enable do
|
||||
on roles(:app) do
|
||||
maintenance_html_path = "#{current_path}/public/maintenance.html"
|
||||
if test("[ -e #{maintenance_html_path} ]")
|
||||
execute :mv, maintenance_html_path, "#{current_path}/public/maintenance.html.bak"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user