Created
September 22, 2017 04:27
-
-
Save kbrownlees/80c1a16aa226e5d52677e011b14767a9 to your computer and use it in GitHub Desktop.
Bash script to create a frozen set of a requirements from a requirements.txt using pip
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
#!/usr/bin/env bash | |
set -ex | |
if [ "$1" = "build" ]; then | |
cd /tmp/build | |
mkdir -p cache | |
pip install --cache-dir cache -r requirements.txt | |
pip freeze > requirements_frozen.txt | |
pip list --outdated --format columns | |
else | |
mkdir -p build | |
cp requirements.txt build | |
cp scripts/update_frozen.sh build | |
docker run --rm -it -v $(pwd)/build:/tmp/build python:3.5 /tmp/build/update_frozen.sh build | |
cp build/requirements_frozen.txt requirements_frozen.txt | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment