Merge pull request #4205 from betagouv/remove-old-after-parties

Remove nonworking after_party rake tasks
This commit is contained in:
LeSim 2019-08-20 14:06:15 +02:00 committed by GitHub
commit 9ba3de65de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 0 additions and 88 deletions

View file

@ -1,18 +0,0 @@
namespace :after_party do
desc 'Deployment task: add_procedure_administrateur_to_administrateurs'
task add_procedure_administrateur_to_administrateurs: :environment do
rake_puts "Running deploy task: 'add_procedure_administrateur_to_administrateurs'"
procedures = Procedure.includes(:administrateurs)
progress = ProgressReport.new(procedures.count)
procedures.find_each do |procedure|
if !procedure.administrateurs.include?(procedure.administrateur)
procedure.administrateurs << procedure.administrateur
end
progress.inc
end
progress.finish
AfterParty::TaskRecord.create version: '20190226101524'
end
end

View file

@ -1,22 +0,0 @@
namespace :after_party do
desc 'Deployment task: migrate_virus_scans'
task migrate_virus_scans: :environment do
puts "Running deploy task 'migrate_virus_scans'"
virus_scans = VirusScan.all
progress = ProgressReport.new(virus_scans.count)
virus_scans.find_each do |virus_scan|
blob = ActiveStorage::Blob.find_by(key: virus_scan.blob_key)
if blob
metadata = { virus_scan_result: virus_scan.status, scanned_at: virus_scan.scanned_at }
blob.update_column(:metadata, blob.metadata.merge(metadata))
end
progress.inc
end
progress.finish
# Update task as completed. If you remove the line below, the task will
# run with every deploy (or every time you call after_party:run).
AfterParty::TaskRecord.create version: '20190425102459'
end
end

View file

@ -1,19 +0,0 @@
namespace :after_party do
desc 'Deployment task: add_procedure_administrateur_to_administrateurs_for_hidden_procedures'
task add_procedure_administrateur_to_administrateurs_for_hidden_procedures: :environment do
rake_puts "Running deploy task: 'add_procedure_administrateur_to_administrateurs_for_hidden_procedures'"
hidden_procedures = Procedure.unscoped.hidden.includes(:administrateurs)
progress = ProgressReport.new(hidden_procedures.count)
hidden_procedures.find_each do |procedure|
deprecated_administrateur = Administrateur.find_by(id: procedure.administrateur_id)
if deprecated_administrateur && !procedure.administrateurs.include?(deprecated_administrateur)
procedure.administrateurs << deprecated_administrateur
end
progress.inc
end
progress.finish
AfterParty::TaskRecord.create version: '20190429103024'
end
end

View file

@ -1,8 +0,0 @@
namespace :after_party do
desc 'Deployment task: enable_secured_login_for_all'
task enable_secured_login_for_all: :environment do
Gestionnaire.update_all(features: { "enable_email_login_token": true })
AfterParty::TaskRecord.create version: '20190627142239'
end
end

View file

@ -1,21 +0,0 @@
namespace :after_party do
desc 'Deployment task: purge_unattached_piece_justificative'
task purge_unattached_piece_justificative: :environment do
puts "Running deploy task 'purge_unattached_piece_justificative'"
piece_justificatives = PieceJustificative.where(type_de_piece_justificative_id: nil)
progress = ProgressReport.new(piece_justificatives.count)
piece_justificatives.find_each do |pj|
# detach from dossier to ensure we do not trigger touch
pj.update_column(:dossier_id, nil)
pj.remove_content!
pj.destroy
progress.inc
end
progress.finish
# Update task as completed. If you remove the line below, the task will
# run with every deploy (or every time you call after_party:run).
AfterParty::TaskRecord.create version: '20190701131030'
end
end