diff options
Diffstat (limited to 'scripts/assets-compile-cache')
-rwxr-xr-x | scripts/assets-compile-cache/archive | 10 | ||||
-rwxr-xr-x | scripts/assets-compile-cache/clean-old-assets | 6 | ||||
-rwxr-xr-x | scripts/assets-compile-cache/extract | 9 |
3 files changed, 25 insertions, 0 deletions
diff --git a/scripts/assets-compile-cache/archive b/scripts/assets-compile-cache/archive new file mode 100755 index 00000000000..85b145ec3b4 --- /dev/null +++ b/scripts/assets-compile-cache/archive @@ -0,0 +1,10 @@ +#!/bin/bash + +echo "Archiving cache files..." + +mkdir -p cache_archives +[ -d vendor/ruby ] && tar -czf cache_archives/vendor-ruby.tar.gz vendor/ruby +[ -d .yarn-cache ] && tar -czf cache_archives/yarn-cache.tar.gz .yarn-cache +[ -d tmp/cache/assets/sprockets ] && tar -czf cache_archives/tmp-cache-assets-sprockets.tar.gz tmp/cache/assets/sprockets + +echo "Done!" diff --git a/scripts/assets-compile-cache/clean-old-assets b/scripts/assets-compile-cache/clean-old-assets new file mode 100755 index 00000000000..8bdd3a9cdb6 --- /dev/null +++ b/scripts/assets-compile-cache/clean-old-assets @@ -0,0 +1,6 @@ +#!/bin/bash + +# Clean up cached files that are older than 4 days +find tmp/cache/assets/sprockets/ -type f -mtime +4 -execdir rm -- "{}" \; + +du -d 0 -h tmp/cache/assets/sprockets | cut -f1 | xargs -I % echo "tmp/cache/assets/sprockets/ is currently %" diff --git a/scripts/assets-compile-cache/extract b/scripts/assets-compile-cache/extract new file mode 100755 index 00000000000..aebf92a9347 --- /dev/null +++ b/scripts/assets-compile-cache/extract @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "Extracting cache files..." + +[ -f cache_archives/vendor-ruby.tar.gz ] && tar -xzf cache_archives/vendor-ruby.tar.gz +[ -f cache_archives/yarn-cache.tar.gz ] && tar -xzf cache_archives/yarn-cache.tar.gz +[ -f cache_archives/tmp-cache-assets-sprockets.tar.gz ] && tar -xzf cache_archives/tmp-cache-assets-sprockets.tar.gz + +echo "Done!" |