From 4b55c38ef599e7b1ebb7708a92624d66b8653124 Mon Sep 17 00:00:00 2001 From: Mike Degatano Date: Wed, 3 Jul 2024 11:50:17 -0400 Subject: [PATCH] Split startup scripts for less rebuild (#87) --- .../rootfs/usr/bin/devcontainer_bootstrap | 6 ----- supervisor/rootfs/usr/bin/devcontainer_setup | 23 +++++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100755 supervisor/rootfs/usr/bin/devcontainer_setup diff --git a/supervisor/rootfs/usr/bin/devcontainer_bootstrap b/supervisor/rootfs/usr/bin/devcontainer_bootstrap index 9cfc870..d9f27af 100644 --- a/supervisor/rootfs/usr/bin/devcontainer_bootstrap +++ b/supervisor/rootfs/usr/bin/devcontainer_bootstrap @@ -2,12 +2,6 @@ set -e -bash /usr/bin/supervisor_bootstrap - pip3 install -U setuptools pip pip3 install -r requirements.txt -r requirements_tests.txt pip3 install tox - -pre-commit install - -exit 0 \ No newline at end of file diff --git a/supervisor/rootfs/usr/bin/devcontainer_setup b/supervisor/rootfs/usr/bin/devcontainer_setup new file mode 100755 index 0000000..3b64194 --- /dev/null +++ b/supervisor/rootfs/usr/bin/devcontainer_setup @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -e + +bash /usr/bin/supervisor_bootstrap + +if [ ! -n "$VIRTUAL_ENV" ]; then + if [ -x "$(command -v uv)" ]; then + uv venv venv + else + python3 -m venv venv + fi + source venv/bin/activate +fi + +if ! [ -x "$(command -v uv)" ]; then + python3 -m pip install uv +fi + +bash /usr/bin/devcontainer_bootstrap + +git config --global --add safe.directory "${WORKSPACE_DIRECTORY}" +pre-commit install