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

third argument support for envs in compile

parent 2a083791
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,7 @@
# Usage:
#
# $ bin/compile <build-dir> <cache-dir>
# $ bin/compile <build-dir> <cache-dir> <env-path>
# Fail fast and fail hard.
set -eo pipefail
......@@ -16,6 +15,8 @@ BIN_DIR=$(cd $(dirname $0); pwd) # absolute path
ROOT_DIR=$(dirname $BIN_DIR)
BUILD_DIR=$1
CACHE_DIR=$2
ENV_FILE=$3
CACHED_DIRS=".heroku"
......@@ -222,7 +223,7 @@ puts-step "Installing dependencies using Pip ($PIP_VERSION)"
# Django collectstatic support.
bpwatch start collectstatic
source $BIN_DIR/steps/collectstatic
sub-env $BIN_DIR/steps/collectstatic
bpwatch stop collectstatic
# ### Finalize
......@@ -261,6 +262,6 @@ bpwatch start anvil_appdir_commit
if [ "$SLUG_ID" ]; then
deep-mv $TMP_APP_DIR $APP_DIR
fi
bpwatch stop anvil_appdir_commit
bpwatch stop anvil_appdir_commit
bpwatch stop compile
......@@ -3,5 +3,5 @@
if [ -f bin/post_compile ]; then
echo "-----> Running post-compile hook"
chmod +x bin/post_compile
bin/post_compile
sub-env bin/post_compile
fi
\ No newline at end of file
......@@ -3,5 +3,5 @@
if [ -f bin/pre_compile ]; then
echo "-----> Running pre-compile hook"
chmod +x bin/pre_compile
bin/pre_compile
sub-env bin/pre_compile
fi
\ No newline at end of file
......@@ -59,4 +59,6 @@ function deep-rm (){
find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \;
}
function sub-env (){
(export $(egrep -v '^(GIT_DIR|PYTHONHOME|PYTHONPATH|LD_LIBRARY_PATH|LIBRARY_PATH|PATH)' $ENV_FILE); $1)
}
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