mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 018e0f31de | |||
| cf1647e937 | |||
| 4cc18ce0af | |||
| f5ea1c24a3 | |||
| 952b0bb735 | |||
| 8b7edad8a2 | |||
| 02787ac910 | |||
| 31e65dc58b | |||
| 9a227e6c73 | |||
| ddc9c24d34 | |||
| 42488a2be7 | |||
| 839486c25b | |||
| 5d56200179 |
+13
-9
@@ -30,16 +30,17 @@ PYTHON_EXE="/app/.heroku/python/bin/python"
|
|||||||
PIP_VERSION="1.3.1"
|
PIP_VERSION="1.3.1"
|
||||||
DISTRIBUTE_VERSION="0.6.36"
|
DISTRIBUTE_VERSION="0.6.36"
|
||||||
|
|
||||||
|
# Setup bpwatch
|
||||||
export PATH=$PATH:$ROOT_DIR/vendor/bpwatch
|
export PATH=$PATH:$ROOT_DIR/vendor/bpwatch
|
||||||
|
|
||||||
LOGPLEX_KEY="t.b396af7f-ad75-4643-8b9e-ebb288acc624"
|
LOGPLEX_KEY="t.b396af7f-ad75-4643-8b9e-ebb288acc624"
|
||||||
BUILDPACK_VERSION=HEAD
|
|
||||||
|
|
||||||
export BPWATCH_STORE_PATH=$CACHE_DIR/bpwatch.json
|
export BPWATCH_STORE_PATH=$CACHE_DIR/bpwatch.json
|
||||||
|
BUILDPACK_VERSION=v28
|
||||||
|
|
||||||
|
# Support Anvil Build_IDs
|
||||||
[ ! "$REQUEST_ID" ] && REQUEST_ID=$SLUG_ID
|
[ ! "$REQUEST_ID" ] && REQUEST_ID=$SLUG_ID
|
||||||
|
|
||||||
|
# Sanitizing environment variables.
|
||||||
|
unset GIT_DIR PYTHONHOME PYTHONPATH LD_LIBRARY_PATH LIBRARY_PATH
|
||||||
|
|
||||||
bpwatch init $LOGPLEX_KEY
|
bpwatch init $LOGPLEX_KEY
|
||||||
bpwatch build python $BUILDPACK_VERSION $REQUEST_ID
|
bpwatch build python $BUILDPACK_VERSION $REQUEST_ID
|
||||||
@@ -48,9 +49,6 @@ TMP_APP_DIR=$CACHE_DIR/tmp_app_dir
|
|||||||
bpwatch start compile
|
bpwatch start compile
|
||||||
|
|
||||||
|
|
||||||
# Sanitizing environment variables.
|
|
||||||
unset GIT_DIR PYTHONHOME PYTHONPATH LD_LIBRARY_PATH LIBRARY_PATH
|
|
||||||
|
|
||||||
# We'll need to send these statics to other scripts we `source`.
|
# We'll need to send these statics to other scripts we `source`.
|
||||||
export BUILD_DIR CACHE_DIR BIN_DIR PROFILE_PATH
|
export BUILD_DIR CACHE_DIR BIN_DIR PROFILE_PATH
|
||||||
|
|
||||||
@@ -63,8 +61,12 @@ TMP_APP_DIR=$CACHE_DIR/tmp_app_dir
|
|||||||
|
|
||||||
# Copy Anvil app dir to temporary storage...
|
# Copy Anvil app dir to temporary storage...
|
||||||
bpwatch start anvil_appdir_stage
|
bpwatch start anvil_appdir_stage
|
||||||
|
if [ "$SLUG_ID" ]; then
|
||||||
mkdir -p $TMP_APP_DIR
|
mkdir -p $TMP_APP_DIR
|
||||||
deep-mv $APP_DIR $TMP_APP_DIR
|
deep-mv $APP_DIR $TMP_APP_DIR
|
||||||
|
else
|
||||||
|
deep-rm $APP_DIR
|
||||||
|
fi
|
||||||
bpwatch stop anvil_appdir_stage
|
bpwatch stop anvil_appdir_stage
|
||||||
|
|
||||||
# Copy Application code in.
|
# Copy Application code in.
|
||||||
@@ -199,7 +201,7 @@ bpwatch stop pylibmc_install
|
|||||||
# Install Mercurial if it appears to be required.
|
# Install Mercurial if it appears to be required.
|
||||||
if (grep -Fiq "hg+" requirements.txt) then
|
if (grep -Fiq "hg+" requirements.txt) then
|
||||||
bpwatch start mercurial_install
|
bpwatch start mercurial_install
|
||||||
/app/.heroku/python/bin/pip install --use-mirrors mercurial | cleanup | indent
|
/app/.heroku/python/bin/pip install mercurial | cleanup | indent
|
||||||
bpwatch stop mercurial_install
|
bpwatch stop mercurial_install
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -210,7 +212,7 @@ puts-step "Installing dependencies using Pip ($PIP_VERSION)"
|
|||||||
[ ! "$FRESH_PYTHON" ] && bpwatch start pip_install
|
[ ! "$FRESH_PYTHON" ] && bpwatch start pip_install
|
||||||
[ "$FRESH_PYTHON" ] && bpwatch start pip_install_first
|
[ "$FRESH_PYTHON" ] && bpwatch start pip_install_first
|
||||||
|
|
||||||
/app/.heroku/python/bin/pip install --use-mirrors -r requirements.txt --exists-action=w --src=./.heroku/src | cleanup | indent
|
/app/.heroku/python/bin/pip install -r requirements.txt --exists-action=w --src=./.heroku/src | cleanup | indent
|
||||||
|
|
||||||
[ ! "$FRESH_PYTHON" ] && bpwatch stop pip_install
|
[ ! "$FRESH_PYTHON" ] && bpwatch stop pip_install
|
||||||
[ "$FRESH_PYTHON" ] && bpwatch stop pip_install_first
|
[ "$FRESH_PYTHON" ] && bpwatch stop pip_install_first
|
||||||
@@ -253,7 +255,9 @@ deep-mv $BUILD_DIR $ORIG_BUILD_DIR
|
|||||||
bpwatch stop appdir_commit
|
bpwatch stop appdir_commit
|
||||||
|
|
||||||
bpwatch start anvil_appdir_commit
|
bpwatch start anvil_appdir_commit
|
||||||
|
if [ "$SLUG_ID" ]; then
|
||||||
deep-mv $TMP_APP_DIR $APP_DIR
|
deep-mv $TMP_APP_DIR $APP_DIR
|
||||||
|
fi
|
||||||
bpwatch stop anvil_appdir_commit
|
bpwatch stop anvil_appdir_commit
|
||||||
|
|
||||||
bpwatch stop compile
|
bpwatch stop compile
|
||||||
|
|||||||
@@ -52,3 +52,11 @@ function deep-mv (){
|
|||||||
rm -fr $1/!(tmp)
|
rm -fr $1/!(tmp)
|
||||||
find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \;
|
find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Does some serious deleting.
|
||||||
|
function deep-rm (){
|
||||||
|
rm -fr $1/!(tmp)
|
||||||
|
find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
@@ -5,8 +5,8 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
DEFUALT_PATH = '{}.zip'.format(os.path.abspath(__file__))
|
DEFAULT_PATH = '{}.zip'.format(os.path.abspath(__file__))
|
||||||
BPWATCH_DISTRO_PATH = os.environ.get('BPWATCH_DISTRO_PATH', DEFUALT_PATH)
|
BPWATCH_DISTRO_PATH = os.environ.get('BPWATCH_DISTRO_PATH', DEFAULT_PATH)
|
||||||
|
|
||||||
sys.path.insert(0, BPWATCH_DISTRO_PATH)
|
sys.path.insert(0, BPWATCH_DISTRO_PATH)
|
||||||
|
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user