From fdbc76be83e4fd1f4651cca740a2bb3cad84fe23 Mon Sep 17 00:00:00 2001 From: Alex Stuart Date: Thu, 23 Jul 2020 12:46:20 +0100 Subject: [PATCH] gzip json discofeed files in temporary directory --- utilities/githooks/post-receive | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/utilities/githooks/post-receive b/utilities/githooks/post-receive index 946104f4..58e146c0 100755 --- a/utilities/githooks/post-receive +++ b/utilities/githooks/post-receive @@ -11,6 +11,11 @@ apachemdqdir=/var/www/html/mdq.uou/entities # Set the location of the temporary mdq cache dir mdqcachedir=/tmp/mdqcache +# Set the location of JSON discofeed files +jsontempdir=/tmp +discofeed=discofeed.json +discofeedall=discofeed-all.json + # This Git repo has had the latest stuff pushed to it, but it hasn't checked it out yet. So let's do it. git --work-tree=$gitdir --git-dir=$gitdir/.git checkout -f @@ -22,6 +27,12 @@ do done echo "Done." +# The JSON files should have been SCPed to /tmp and be sitting there happily. +echo -n "Gzipping 2 JSON discofeed files..." +gzip -9 < "${jsontempdir}/$discofeed" > "${jsontempdir}/${discofeed}.gz" +gzip -9 < "${jsontempdir}/$discofeedall" > "${jsontempdir}/${discofeedall}.gz" +echo "Done." + # The MDQ cache should have been SCPed to /tmp and be sitting there happily. # First, we should untar it. echo -n "Untarring mdq cache... "