Skip to content

Commit 385296c

Browse files
committed
Add support for testing binaries in staging/ on S3
This will allow for faster and more transparent deploys for Python and other built dependencies.
1 parent 12279e6 commit 385296c

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ repos/*
88
#Venv
99
buildpack/*
1010

11-
builds/dockerenv
11+
builds/dockerenv.staging*
12+
builds/dockerenv.production

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ check:
88
@shellcheck -x bin/steps/collectstatic bin/steps/eggpath-fix bin/steps/eggpath-fix2 bin/steps/gdal bin/steps/geo-libs bin/steps/mercurial bin/steps/nltk bin/steps/pip-install bin/steps/pip-uninstall bin/steps/pipenv bin/steps/pipenv-python-version bin/steps/pylibmc bin/steps/python
99
@shellcheck -x bin/steps/hooks/*
1010

11+
test-staging:
12+
@echo "Running tests against staged binaries..."
13+
@docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=heroku-16" -e "TEST_STAGED_S3_BINARIES=1" heroku/heroku:16-build bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
14+
@echo ""
15+
@echo "Running tests in docker (heroku-18)..."
16+
@docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=heroku-18" -e "TEST_STAGED_S3_BINARIES=1" heroku/heroku:18-build bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
17+
@echo ""
18+
1119
test-heroku-16:
1220
@echo "Running tests in docker (heroku-16)..."
1321
@docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=heroku-16" heroku/heroku:16-build bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'

bin/compile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ VENDOR_URL="https://lang-python.s3.amazonaws.com/$STACK"
4343
if [[ -n ${BUILDPACK_VENDOR_URL:-} ]]; then
4444
VENDOR_URL="$BUILDPACK_VENDOR_URL"
4545
fi
46+
47+
# Build binaries (python runtimes, etc) in the /staging/ directory on S3. Test
48+
these binaries for compatibility when passed this environment variable.
49+
if [ "$TEST_STAGED_S3_BINARIES" == "1" ]; then
50+
echo "Testing staged binaries..."
51+
VENDOR_URL="https://lang-python.s3.amazonaws.com/staging/$STACK"
52+
fi
4653
export VENDOR_URL
4754

4855
# Default Python Versions

0 commit comments

Comments
 (0)