From 05edd6b065aa7fab89f3312102cc1d5032258e2f Mon Sep 17 00:00:00 2001 From: Kenneth Reitz <me@kennethreitz.org> Date: Tue, 27 Oct 2015 12:15:53 -0400 Subject: [PATCH] update to caching mechanism --- bin/compile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/bin/compile b/bin/compile index d81772ea..a62aa1be 100755 --- a/bin/compile +++ b/bin/compile @@ -20,7 +20,7 @@ CACHE_DIR=$2 ENV_DIR=$3 -CACHED_DIRS=".heroku" +CACHED_DIR=".heroku" # Static configurations for virtualenv caches. VIRTUALENV_LOC=".heroku/venv" @@ -145,9 +145,14 @@ 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 - done + mkdir -p .heroku + + cp -R $CACHE_DIR/$CACHED_DIR/python .heroku/ &> /dev/null || true + cp -R $CACHE_DIR/$CACHED_DIR/python-stack .heroku/ &> /dev/null || true + cp -R $CACHE_DIR/$CACHED_DIR/python-version .heroku/ &> /dev/null || true + cp -R $CACHE_DIR/$CACHED_DIR/vendor .heroku/ &> /dev/null || true + cp -R $CACHE_DIR/$CACHED_DIR/venv .heroku/ &> /dev/null || true + bpwatch stop restore_cache set +e @@ -209,10 +214,10 @@ bpwatch stop post_compile # Store new artifacts in cache. bpwatch start dump_cache - for dir in $CACHED_DIRS; do - rm -rf $CACHE_DIR/$dir - cp -R $dir $CACHE_DIR/ - done + + rm -rf $CACHE_DIR/$CACHED_DIR + cp -R $CACHED_DIR $CACHE_DIR/ + bpwatch stop dump_cache # ### Fin. -- GitLab