5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 16:11:42 +00:00

cada deploy puede ejecutar tareas de limpieza

pero la mayoría no lo va a necesitar
This commit is contained in:
f 2022-04-15 10:39:44 -03:00
parent 9dee10bcb9
commit 78c0bdcc39
2 changed files with 14 additions and 0 deletions

View file

@ -23,6 +23,9 @@ class Deploy < ApplicationRecord
raise NotImplementedError
end
# Realizar tareas de limpieza.
def cleanup!; end
def time_start
@start = Time.now
end

View file

@ -43,6 +43,17 @@ class DeployLocal < Deploy
File.join(Rails.root, '_deploy', site.hostname)
end
# Libera espacio eliminando archivos temporales
#
# @return [nil]
def cleanup!
FileUtils.rm_rf(gems_dir)
FileUtils.rm_rf(yarn_cache_dir)
FileUtils.rm_rf(File.join(site.path, 'node_modules'))
FileUtils.rm_rf(File.join(site.path, '.sass-cache'))
FileUtils.rm_rf(File.join(site.path, '.jekyll-cache'))
end
private
def mkdir