mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Update caching logic so new apps don't get logs
actually add changes Missing fi
This commit is contained in:
@@ -63,8 +63,8 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
|
||||
# Cache pip packages ourselves
|
||||
## TODO: Update to cache pip's built-in cache
|
||||
|
||||
# Update cached version of requirements.txt
|
||||
cp -R $BUILD_DIR/requirements.txt "$CACHE_DIR/.heroku/requirements.txt"
|
||||
# # Update cached version of requirements.txt
|
||||
# cp -R $BUILD_DIR/requirements.txt "$CACHE_DIR/.heroku/requirements.txt"
|
||||
|
||||
cp requirements.txt .heroku/python/requirements-declared.txt
|
||||
/app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt
|
||||
|
||||
+18
-6
@@ -95,14 +95,26 @@ if [ -f .heroku/python-version ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
echo "$(diff "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt")"
|
||||
|
||||
# Remove python dependencies
|
||||
if [[ ! -f "$CACHE_DIR/.heroku/requirements.txt" ]] || ! diff "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt" ; then
|
||||
# Check if we should reinstall python dependencies
|
||||
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
|
||||
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"; 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
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! "$SKIP_INSTALL" ]; then
|
||||
|
||||
Reference in New Issue
Block a user