Remove tasks to upgrade to version 1.1
These tasks are not needed for new installations, and in existing installations they've already been executed when upgrading to version 1.1. One of them also raises a warning in Rails 5.2: DEPRECATION WARNING: Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): "MIN(id) as id". Non-attribute arguments will be disallowed in Rails 6.0. This method should not be called with user-provided values, such as request parameters or model attributes. Known-safe values can be passed by wrapping them in Arel.sql()
This commit is contained in:
@@ -48,11 +48,9 @@ namespace :deploy do
|
||||
after :updating, "rvm1:install:rvm"
|
||||
after :updating, "rvm1:install:ruby"
|
||||
after :updating, "install_bundler_gem"
|
||||
before "deploy:migrate", "remove_local_census_records_duplicates"
|
||||
|
||||
after "deploy:migrate", "add_new_settings"
|
||||
|
||||
before :publishing, "smtp_ssl_and_delay_jobs_secrets"
|
||||
after :publishing, "setup_puma"
|
||||
|
||||
after :published, "deploy:restart"
|
||||
@@ -76,16 +74,6 @@ task :install_bundler_gem do
|
||||
end
|
||||
end
|
||||
|
||||
task :remove_local_census_records_duplicates do
|
||||
on roles(:db) do
|
||||
within release_path do
|
||||
with rails_env: fetch(:rails_env) do
|
||||
execute :rake, "local_census_records:remove_duplicates"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
task :refresh_sitemap do
|
||||
on roles(:app) do
|
||||
within release_path do
|
||||
@@ -116,49 +104,12 @@ task :execute_release_tasks do
|
||||
end
|
||||
end
|
||||
|
||||
desc "Create pid and socket folders needed by puma and convert unicorn sockets into symbolic links \
|
||||
to the puma socket, so legacy nginx configurations pointing to the unicorn socket keep working"
|
||||
desc "Create pid and socket folders needed by puma"
|
||||
task :setup_puma do
|
||||
on roles(:app) do
|
||||
with rails_env: fetch(:rails_env) do
|
||||
execute "mkdir -p #{shared_path}/tmp/sockets; true"
|
||||
execute "mkdir -p #{shared_path}/tmp/pids; true"
|
||||
|
||||
if test("[ -e #{shared_path}/tmp/sockets/unicorn.sock ]")
|
||||
execute "ln -sf #{shared_path}/tmp/sockets/puma.sock #{shared_path}/tmp/sockets/unicorn.sock; true"
|
||||
end
|
||||
|
||||
if test("[ -e #{shared_path}/sockets/unicorn.sock ]")
|
||||
execute "ln -sf #{shared_path}/tmp/sockets/puma.sock #{shared_path}/sockets/unicorn.sock; true"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
task :smtp_ssl_and_delay_jobs_secrets do
|
||||
on roles(:app) do
|
||||
if test("[ -d #{current_path} ]")
|
||||
within current_path do
|
||||
with rails_env: fetch(:rails_env) do
|
||||
tasks_file_path = "lib/tasks/secrets.rake"
|
||||
shared_secrets_path = "#{shared_path}/config/secrets.yml"
|
||||
|
||||
unless test("[ -e #{current_path}/#{tasks_file_path} ]")
|
||||
begin
|
||||
unless test("[ -w #{shared_secrets_path} ]")
|
||||
execute "sudo chown `whoami` #{shared_secrets_path}"
|
||||
execute "chmod u+w #{shared_secrets_path}"
|
||||
end
|
||||
|
||||
execute "cp #{release_path}/#{tasks_file_path} #{current_path}/#{tasks_file_path}"
|
||||
|
||||
execute :rake, "secrets:smtp_ssl_and_delay_jobs"
|
||||
ensure
|
||||
execute "rm #{current_path}/#{tasks_file_path}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user