aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
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