forked from lyft/discovery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script that packages the app in a virtualenv
- Loading branch information
Luke Tyler Downey
committed
Oct 25, 2017
1 parent
cf398a0
commit 1e7c7ac
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
# | ||
# Basic packaging script that rolls the app and its deps | ||
# into a standalone pex | ||
|
||
|
||
# Clean any stale state | ||
rm -rf build | ||
|
||
# Create and push the build dir | ||
mkdir build build/egg build/pex | ||
pushd build | ||
|
||
# Create and activate a virtualenv for chroot-ish packaging | ||
virtualenv venv | ||
source venv/bin/activate | ||
|
||
# Install pex and its dependencies then package up the app | ||
pip install pex | ||
pex .. -v \ | ||
--output-file=discovery.pex \ | ||
--requirement=$(realpath ../requirements.txt) \ | ||
--disable-cache \ | ||
--pex-root=pex \ | ||
-e app:app.run | ||
|
||
# Deactivate the virtualenv | ||
deactivate | ||
|
||
# Pop back to the top-level dir | ||
popd |