Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
heroku-buildpack-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Evili del Rio i Silvan
heroku-buildpack-python
Commits
eb3e7851
Commit
eb3e7851
authored
9 years ago
by
Kenneth Reitz
Browse files
Options
Downloads
Patches
Plain Diff
compile comments
parent
78b6142d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/compile
+14
-8
14 additions, 8 deletions
bin/compile
with
14 additions
and
8 deletions
bin/compile
+
14
−
8
View file @
eb3e7851
#!/usr/bin/env bash
#!/usr/bin/env bash
# The Heroku Python Buildpack. This script accepts paramaters for a build
# directory, a cache directory, and a directory for app environment variables.
# Warning: there are a few hacks in this script to accomidate excellent builds
# on Heroku. No gaurentee for external compatibility is made. However,
# everything should work fine outside of the Heroku environment, if the
# environment is setup correctly.
# Usage:
# Usage:
#
#
# $ bin/compile <build-dir> <cache-dir> <env-path>
# $ bin/compile <build-dir> <cache-dir> <env-path>
...
@@ -51,6 +59,7 @@ unset GIT_DIR PYTHONHOME PYTHONPATH LD_LIBRARY_PATH LIBRARY_PATH
...
@@ -51,6 +59,7 @@ unset GIT_DIR PYTHONHOME PYTHONPATH LD_LIBRARY_PATH LIBRARY_PATH
unset
RECEIVE_DATA SOURCE_VERSION RUN_KEY BUILD_INFO DEPLOY
unset
RECEIVE_DATA SOURCE_VERSION RUN_KEY BUILD_INFO DEPLOY
unset
LOG_TOKEN DYNO CYTOKINE_LOG_FILE GEM_PATH
unset
LOG_TOKEN DYNO CYTOKINE_LOG_FILE GEM_PATH
# Setup buildpack instrumentation.
bpwatch init
$LOGPLEX_KEY
bpwatch init
$LOGPLEX_KEY
bpwatch build python
$BUILDPACK_VERSION
$REQUEST_ID
bpwatch build python
$BUILDPACK_VERSION
$REQUEST_ID
TMP_APP_DIR
=
$CACHE_DIR
/tmp_app_dir
TMP_APP_DIR
=
$CACHE_DIR
/tmp_app_dir
...
@@ -98,7 +107,7 @@ WEBCONCURRENCY_PROFILE_PATH="$BUILD_DIR/.profile.d/python.webconcurrency.sh"
...
@@ -98,7 +107,7 @@ WEBCONCURRENCY_PROFILE_PATH="$BUILD_DIR/.profile.d/python.webconcurrency.sh"
# 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
# Prepend proper
path buildpack
use.
# Prepend proper
environment variables for Python
use.
export
PATH
=
$BUILD_DIR
/.heroku/python/bin:
$BUILD_DIR
/.heroku/vendor/bin:
$PATH
export
PATH
=
$BUILD_DIR
/.heroku/python/bin:
$BUILD_DIR
/.heroku/vendor/bin:
$PATH
export
PYTHONUNBUFFERED
=
1
export
PYTHONUNBUFFERED
=
1
export
LANG
=
en_US.UTF-8
export
LANG
=
en_US.UTF-8
...
@@ -122,7 +131,7 @@ bpwatch start pre_compile
...
@@ -122,7 +131,7 @@ bpwatch start pre_compile
source
$BIN_DIR
/steps/hooks/pre_compile
source
$BIN_DIR
/steps/hooks/pre_compile
bpwatch stop pre_compile
bpwatch stop pre_compile
# If no requirements given, assume `setup.py develop`.
# If no requirements
.txt file
given, assume `setup.py develop`
is intended
.
if
[
!
-f
requirements.txt
]
;
then
if
[
!
-f
requirements.txt
]
;
then
echo
"-e ."
>
requirements.txt
echo
"-e ."
>
requirements.txt
fi
fi
...
@@ -145,7 +154,7 @@ if [ ! -f runtime.txt ]; then
...
@@ -145,7 +154,7 @@ if [ ! -f runtime.txt ]; then
echo
$DEFAULT_PYTHON_VERSION
>
runtime.txt
echo
$DEFAULT_PYTHON_VERSION
>
runtime.txt
fi
fi
#
### T
he
C
ache
#
Prepare t
he
c
ache
.
mkdir
-p
$CACHE_DIR
mkdir
-p
$CACHE_DIR
# Purge "old-style" virtualenvs.
# Purge "old-style" virtualenvs.
...
@@ -201,10 +210,7 @@ source $BIN_DIR/steps/pip-install
...
@@ -201,10 +210,7 @@ source $BIN_DIR/steps/pip-install
sub-env
$BIN_DIR
/steps/collectstatic
sub-env
$BIN_DIR
/steps/collectstatic
# ### Finalize
# Create .profile script for application runtime environment variables.
#
# Set context environment variables.
set-env PATH
'$HOME/.heroku/python/bin:$PATH'
set-env PATH
'$HOME/.heroku/python/bin:$PATH'
set-env PYTHONUNBUFFERED
true
set-env PYTHONUNBUFFERED
true
set-env PYTHONHOME /app/.heroku/python
set-env PYTHONHOME /app/.heroku/python
...
@@ -241,7 +247,7 @@ bpwatch start dump_cache
...
@@ -241,7 +247,7 @@ bpwatch start dump_cache
bpwatch stop dump_cache
bpwatch stop dump_cache
# ##
# Fin.
# Fin.
if
[[
!
"
$DOCKER_BUILD
"
]]
;
then
if
[[
!
"
$DOCKER_BUILD
"
]]
;
then
bpwatch start appdir_commit
bpwatch start appdir_commit
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment