Skip to content
Snippets Groups Projects
Commit a259143c authored by Ed Morley's avatar Ed Morley
Browse files

Avoid repetition of vendor library environment variable setting

Since we need to set it regardless of whether the vendored library
existed previously or not.
parent 0896d6a0
No related branches found
No related tags found
No related merge requests found
...@@ -22,16 +22,14 @@ bpwatch start libffi_install ...@@ -22,16 +22,14 @@ bpwatch start libffi_install
# If a package using cffi exists within requirements, use vendored libffi. # If a package using cffi exists within requirements, use vendored libffi.
if (pip-grep -s requirements.txt bcrypt cffi cryptography django[bcrypt] Django[bcrypt] PyNaCl pyOpenSSL PyOpenSSL requests[security] misaka &> /dev/null) then if (pip-grep -s requirements.txt bcrypt cffi cryptography django[bcrypt] Django[bcrypt] PyNaCl pyOpenSSL PyOpenSSL requests[security] misaka &> /dev/null) then
if [ -d ".heroku/vendor/lib/libffi-3.1.1" ]; then if [ ! -d ".heroku/vendor/lib/libffi-3.1.1" ]; then
export LIBFFI=$(pwd)/vendor
else
echo "-----> Noticed cffi. Bootstrapping libffi." echo "-----> Noticed cffi. Bootstrapping libffi."
mkdir -p .heroku/vendor mkdir -p .heroku/vendor
# Download and extract libffi into target vendor directory. # Download and extract libffi into target vendor directory.
curl $VENDORED_LIBFFI -s | tar zxv -C .heroku/vendor &> /dev/null curl $VENDORED_LIBFFI -s | tar zxv -C .heroku/vendor &> /dev/null
export LIBFFI=$(pwd)/vendor
fi fi
export LIBFFI=$(pwd)/vendor
fi fi
bpwatch stop libffi_install bpwatch stop libffi_install
...@@ -22,16 +22,14 @@ bpwatch start gdal_install ...@@ -22,16 +22,14 @@ bpwatch start gdal_install
# If GDAL exists within requirements, use vendored gdal. # If GDAL exists within requirements, use vendored gdal.
if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then
if [ -f ".heroku/vendor/bin/gdalserver" ]; then if [ ! -f ".heroku/vendor/bin/gdalserver" ]; then
export GDAL=$(pwd)/vendor
else
echo "-----> Noticed GDAL. Bootstrapping gdal." echo "-----> Noticed GDAL. Bootstrapping gdal."
mkdir -p .heroku/vendor mkdir -p .heroku/vendor
# Download and extract cryptography into target vendor directory. # Download and extract cryptography into target vendor directory.
curl $VENDORED_GDAL -s | tar zxv -C .heroku/vendor &> /dev/null curl $VENDORED_GDAL -s | tar zxv -C .heroku/vendor &> /dev/null
export GDAL=$(pwd)/vendor
fi fi
export GDAL=$(pwd)/vendor
fi fi
bpwatch stop gdal_install bpwatch stop gdal_install
...@@ -24,18 +24,16 @@ bpwatch start geo_libs_install ...@@ -24,18 +24,16 @@ bpwatch start geo_libs_install
# If GDAL exists within requirements, use vendored gdal. # If GDAL exists within requirements, use vendored gdal.
if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then
if [ -f ".heroku/vendor/bin/gdalserver" ]; then if [ ! -f ".heroku/vendor/bin/gdalserver" ]; then
export GDAL=$(pwd)/vendor
else
echo "-----> Bootstrapping gdal, geos, proj." echo "-----> Bootstrapping gdal, geos, proj."
mkdir -p .heroku/vendor mkdir -p .heroku/vendor
# Download and extract cryptography into target vendor directory. # Download and extract cryptography into target vendor directory.
curl $VENDORED_GDAL -s | tar zxv -C .heroku/vendor &> /dev/null curl $VENDORED_GDAL -s | tar zxv -C .heroku/vendor &> /dev/null
curl $VENDORED_GEOS -s | tar zxv -C .heroku/vendor &> /dev/null curl $VENDORED_GEOS -s | tar zxv -C .heroku/vendor &> /dev/null
curl $VENDORED_PROJ -s | tar zxv -C .heroku/vendor &> /dev/null curl $VENDORED_PROJ -s | tar zxv -C .heroku/vendor &> /dev/null
export GDAL=$(pwd)/vendor
fi fi
export GDAL=$(pwd)/vendor
fi fi
bpwatch stop geo_libs_install bpwatch stop geo_libs_install
...@@ -21,16 +21,14 @@ bpwatch start pylibmc_install ...@@ -21,16 +21,14 @@ bpwatch start pylibmc_install
# If pylibmc exists within requirements, use vendored libmemcached. # If pylibmc exists within requirements, use vendored libmemcached.
if (pip-grep -s requirements.txt pylibmc &> /dev/null) then if (pip-grep -s requirements.txt pylibmc &> /dev/null) then
if [ -d ".heroku/vendor/lib/sasl2" ]; then if [ ! -d ".heroku/vendor/lib/sasl2" ]; then
export LIBMEMCACHED=$(pwd)/vendor
else
echo "-----> Noticed pylibmc. Bootstrapping libmemcached." echo "-----> Noticed pylibmc. Bootstrapping libmemcached."
mkdir -p .heroku/vendor mkdir -p .heroku/vendor
# Download and extract libmemcached into target vendor directory. # Download and extract libmemcached into target vendor directory.
curl $VENDORED_MEMCACHED -s | tar zxv -C .heroku/vendor &> /dev/null curl $VENDORED_MEMCACHED -s | tar zxv -C .heroku/vendor &> /dev/null
export LIBMEMCACHED=$(pwd)/vendor
fi fi
export LIBMEMCACHED=$(pwd)/vendor
fi fi
bpwatch stop pylibmc_install bpwatch stop pylibmc_install
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