mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Bugfix: Caching on subsequent redeploys (#948)
* Don't clear the cache on first app deploy * Add output for debugging cache behavior * Debug output of changes, clean up whitespace * Update hatchet to use latest getting started guide * Clean up caching output logs This output was confusing and unhelptul to most users * Changelog * Test if we need these lines * dang fi * Remove unnecessary code * Remove confusing output of change * Update log output * Update test to match new expected log output * Update changelog
This commit is contained in:
+4
-9
@@ -100,22 +100,17 @@ if [[ ! -f "$CACHE_DIR/.heroku/requirements.txt" ]]; then
|
||||
# IF there's no cached dependencies, update cached version of requirements.txt
|
||||
# This should only run for new apps and first deploys after this update
|
||||
cp -R "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt"
|
||||
# If we don't already have a python version, this is a new app
|
||||
if [ -f .heroku/python-version ]; then
|
||||
puts-step "Clearing cached dependencies"
|
||||
# if there are any differences, clear the Python cache
|
||||
# Installing Python over again does not take noticably more time
|
||||
rm -rf .heroku/python
|
||||
unset SKIP_INSTALL
|
||||
fi
|
||||
else
|
||||
# IF there IS a cached directory, check for differences with the new one
|
||||
if ! diff "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt" &> /dev/null; then
|
||||
puts-step "Clearing cached dependencies"
|
||||
puts-step "Requirements file has been changed, clearing cached dependencies"
|
||||
# if there are any differences, clear the Python cache
|
||||
# Installing Python over again does not take noticably more time
|
||||
cp -R "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt"
|
||||
rm -rf .heroku/python
|
||||
unset SKIP_INSTALL
|
||||
else
|
||||
puts-step "No change in requirements detected, installing from cache"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user