Skip to content

Commit

Permalink
Script that packages the app in a virtualenv
Browse files Browse the repository at this point in the history
  • 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.
31 changes: 31 additions & 0 deletions build.sh
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

0 comments on commit 1e7c7ac

Please sign in to comment.