Skip to content
Snippets Groups Projects
Commit 4e2dd4b6 authored by Kenneth Reitz's avatar Kenneth Reitz
Browse files

Move pylibmc venderization to separate script

parent f9f9ae54
No related branches found
No related tags found
No related merge requests found
......@@ -31,23 +31,22 @@ EOF
cd $BUILD_DIR
# reject a non-packaged Django app
# Reject a non-packaged Django app.
if [ "$NAME" = "Python" ]; then
[ -f manage.py ] && [ -f settings.py ] && { echo " ! Django app must be in a package subdirectory"; exit 1; }
fi
# warn a checked-in virtualenv
# Warn a checked-in virtualenv.
if [ -d "lib" ] || [ -d "bin" ]; then
echo " ! You have a virtualenv checked in. You should ignore the appropriate paths in your repo. See http://devcenter.heroku.com/articles/gitignore for more info.";
fi
# reject a conflicting checked-in virtualenv
# Reject a conflicting checked-in virtualenv.
if [ -f "lib/python2.7" ]; then
echo " ! Checked-in virtualenv conflict."
exit 1;
fi
# copy artifacts out of cache if exists
mkdir -p $CACHE_DIR
for dir in $VIRTUALENV_DIRS; do
......@@ -60,31 +59,13 @@ virtualenv --no-site-packages . | indent
# create set-aside .heroku folder.
mkdir -p .heroku
# Pylibmc support.
source $BIN_DIR/steps/pylibmc
# if pylibmc within requirements, use vendored libmemcached
if (grep -Fxiq "pylibmc" requirements.txt) || (grep -Fiq "pylibmc=" requirements.txt)
then
echo "-----> Noticed pylibmc. Bootstrapping libmemcached."
cd .heroku
if [ -d "vendor/lib/sasl2" ]; then
export LIBMEMCACHED=$(pwd)/vendor
else
curl -s -L -o tmp-libmemcached.tar.gz $VENDORED_MEMCACHED
tar -zxvf tmp-libmemcached.tar.gz > /dev/null
rm tmp-libmemcached.tar.gz
export LIBMEMCACHED=$(pwd)/vendor
fi
export LIBMEMCACHED=$(pwd)/vendor
cd ..
fi
# Activate the virtualenv.
echo "-----> Activating virtualenv"
source bin/activate
# Install mercurial, if needed.
if (grep -Fiq "hg+" requirements.txt) then
pip install --use-mirrors mercurial | indent
......@@ -94,13 +75,11 @@ fi
echo "-----> Installing dependencies using pip version $(bin/pip --version | awk '{print $2}')"
pip install --use-mirrors -r requirements.txt | indent
# if Django, append settings
# Django support.
if [ "$NAME" = "Python/Django" ]; then
source $BIN_DIR/steps/django
fi
# Make virtualenv relocatable.
set +e
OUT=$(virtualenv --relocatable .)
......
#!/usr/bin/env bash
# if pylibmc within requirements, use vendored libmemcached
if (grep -Fxiq "pylibmc" requirements.txt) || (grep -Fiq "pylibmc=" requirements.txt)
then
echo "-----> Noticed pylibmc. Bootstrapping libmemcached."
cd .heroku
if [ -d "vendor/lib/sasl2" ]; then
export LIBMEMCACHED=$(pwd)/vendor
else
curl -s -L -o tmp-libmemcached.tar.gz $VENDORED_MEMCACHED
tar -zxvf tmp-libmemcached.tar.gz > /dev/null
rm tmp-libmemcached.tar.gz
export LIBMEMCACHED=$(pwd)/vendor
fi
export LIBMEMCACHED=$(pwd)/vendor
cd ..
fi
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