aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorCody Hiar <cody@hiar.ca>2022-02-17 13:57:09 -0700
committerCody Hiar <cody@hiar.ca>2022-02-17 13:57:09 -0700
commit17565578c7f3a5443943ca68e481126825825439 (patch)
tree9a3cee77c09dba0e8ca2484eda34d37dc1ae3687 /bin
Initial commitHEADmaster
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/build.sh b/bin/build.sh
new file mode 100755
index 0000000..f7fb60e
--- /dev/null
+++ b/bin/build.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+# This reads this .python-version file and will install that version if it
+# doesn't already exist. Only install if the pyenv command is present, if we
+# are running this in an environment where the host python is already set, like
+# a docker container or provisioned host, we can skip using pyenv
+[[ -x "$(command -v pyenv)" ]] && pyenv install --skip-existing
+
+# If the virtualenv already exits, exit cleanly
+[[ -d ".venv" ]] && echo "Virtual environment already exists" && exit 0
+
+# Create the virtual env
+python -m venv --prompt localstack .venv
+
+# Install the requirements
+./.venv/bin/pip install -r requirements.txt