mirror of
https://github.com/home-assistant/core.git
synced 2025-04-19 14:57:52 +00:00
Call setup during devcontainer create (#46224)
This commit is contained in:
parent
81c88cd639
commit
e20a814926
@ -2,7 +2,8 @@
|
||||
"name": "Home Assistant Dev",
|
||||
"context": "..",
|
||||
"dockerFile": "../Dockerfile.dev",
|
||||
"postCreateCommand": "script/bootstrap",
|
||||
"postCreateCommand": "script/setup",
|
||||
"postStartCommand": "script/bootstrap",
|
||||
"containerEnv": { "DEVCONTAINER": "1" },
|
||||
"appPort": 8123,
|
||||
"runArgs": ["-e", "GIT_EDITOR=code --wait"],
|
||||
|
@ -6,23 +6,6 @@ set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
# Add default vscode settings if not existing
|
||||
SETTINGS_FILE=./.vscode/settings.json
|
||||
SETTINGS_TEMPLATE_FILE=./.vscode/settings.default.json
|
||||
if [ ! -f "$SETTINGS_FILE" ]; then
|
||||
echo "Copy $SETTINGS_TEMPLATE_FILE to $SETTINGS_FILE."
|
||||
cp "$SETTINGS_TEMPLATE_FILE" "$SETTINGS_FILE"
|
||||
fi
|
||||
|
||||
echo "Installing development dependencies..."
|
||||
python3 -m pip install wheel --constraint homeassistant/package_constraints.txt
|
||||
python3 -m pip install tox colorlog pre-commit $(grep mypy requirements_test.txt) $(grep stdlib-list requirements_test.txt) $(grep tqdm requirements_test.txt) $(grep pipdeptree requirements_test.txt) $(grep awesomeversion requirements.txt) --constraint homeassistant/package_constraints.txt
|
||||
|
||||
if [ -n "$DEVCONTAINER" ];then
|
||||
pre-commit install
|
||||
pre-commit install-hooks
|
||||
python3 -m pip install -e . --constraint homeassistant/package_constraints.txt
|
||||
|
||||
mkdir -p config
|
||||
hass --script ensure_config -c config
|
||||
fi
|
14
script/setup
14
script/setup
@ -6,10 +6,20 @@ set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
# Add default vscode settings if not existing
|
||||
SETTINGS_FILE=./.vscode/settings.json
|
||||
SETTINGS_TEMPLATE_FILE=./.vscode/settings.default.json
|
||||
if [ ! -f "$SETTINGS_FILE" ]; then
|
||||
echo "Copy $SETTINGS_TEMPLATE_FILE to $SETTINGS_FILE."
|
||||
cp "$SETTINGS_TEMPLATE_FILE" "$SETTINGS_FILE"
|
||||
fi
|
||||
|
||||
mkdir -p config
|
||||
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
if [ ! -n "$DEVCONTAINER" ];then
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
fi
|
||||
|
||||
script/bootstrap
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user