Skip to content
Snippets Groups Projects
Commit 18c404f7 authored by Ed Morley's avatar Ed Morley Committed by Kenneth Reitz
Browse files

Restore the build cache prior to running bin/pre_compile (#372)

So that any changes made to `.heroku/` within pre_compile (such as
installing additional libraries required for the later pip install) are
not clobbered by the cache being copied over afterwards.

Fixes #320.
parent 84f2fb53
No related branches found
No related tags found
No related merge requests found
......@@ -92,6 +92,20 @@ if [[ ! -f Procfile ]]; then
puts-warn 'Learn more: https://devcenter.heroku.com/articles/procfile'
fi
# Prepare the cache.
mkdir -p $CACHE_DIR
# Restore old artifacts from the cache.
mkdir -p .heroku
cp -R $CACHE_DIR/.heroku/python .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/python-stack .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/python-version .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/vendor .heroku/ &> /dev/null || true
if [[ -d $CACHE_DIR/.heroku/src ]]; then
cp -R $CACHE_DIR/.heroku/src .heroku/ &> /dev/null || true
fi
# Experimental pre_compile hook.
source $BIN_DIR/steps/hooks/pre_compile
......@@ -115,21 +129,6 @@ if [ ! -f runtime.txt ]; then
echo $DEFAULT_PYTHON_VERSION > runtime.txt
fi
# Prepare the cache.
mkdir -p $CACHE_DIR
# Restore old artifacts from the cache.
mkdir -p .heroku
cp -R $CACHE_DIR/.heroku/python .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/python-stack .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/python-version .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/vendor .heroku/ &> /dev/null || true
if [[ -d $CACHE_DIR/.heroku/src ]]; then
cp -R $CACHE_DIR/.heroku/src .heroku/ &> /dev/null || true
fi
mkdir -p $(dirname $PROFILE_PATH)
mkdir -p /app/.heroku/src
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment