summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-06-06 15:53:21 +0800
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-06-07 07:45:48 +0800
commit904b38820aee23d90ce04426ebd84b0eaf4c983a (patch)
treecd99b594f8143558128ff202f83c89ff885d289a /scripts
parente6a88b024fa7f8e1ec5b712744d0e0d118b026e6 (diff)
downloadgitlab-ce-tar-assets-compile-cache-artifacts.tar.gz
Tar assets-compile-cache cache filestar-assets-compile-cache-artifacts
Speeds up zipping and uploading of cache
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/assets-compile-cache/archive10
-rwxr-xr-xscripts/assets-compile-cache/clean-old-assets (renamed from scripts/clean-old-cached-assets)0
-rwxr-xr-xscripts/assets-compile-cache/extract9
3 files changed, 19 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/clean-old-cached-assets b/scripts/assets-compile-cache/clean-old-assets
index 8bdd3a9cdb6..8bdd3a9cdb6 100755
--- a/scripts/clean-old-cached-assets
+++ b/scripts/assets-compile-cache/clean-old-assets
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!"