From 1c82d820c9285e5de3d64c3462826173a3ecf279 Mon Sep 17 00:00:00 2001 From: Owen Jacobson <owen@heroku.com> Date: Fri, 9 Oct 2015 14:31:55 -0400 Subject: [PATCH] Be more conservative to what we cache --- bin/compile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/compile b/bin/compile index d81772ea..6dd4f8b5 100755 --- a/bin/compile +++ b/bin/compile @@ -20,7 +20,7 @@ CACHE_DIR=$2 ENV_DIR=$3 -CACHED_DIRS=".heroku" +CACHE_ENTRIES=".heroku/python .heroku/python-stack .heroku/python-version" # Static configurations for virtualenv caches. VIRTUALENV_LOC=".heroku/venv" @@ -145,8 +145,9 @@ bpwatch stop clear_old_venvs # Restore old artifacts from the cache. bpwatch start restore_cache - for dir in $CACHED_DIRS; do - cp -R $CACHE_DIR/$dir . &> /dev/null || true + for dir in $CACHE_ENTRIES; do + mkdir -p $(basename $dir) + cp -R $CACHE_DIR/$dir $dir &> /dev/null || true done bpwatch stop restore_cache @@ -209,9 +210,10 @@ bpwatch stop post_compile # Store new artifacts in cache. bpwatch start dump_cache - for dir in $CACHED_DIRS; do + for dir in $CACHE_ENTRIES; do rm -rf $CACHE_DIR/$dir - cp -R $dir $CACHE_DIR/ + mkdir -p $(dirname $CACHE_DIR/$dir) + cp -R $dir $CACHE_DIR/$dir done bpwatch stop dump_cache -- GitLab