forked from thomasloven/hass-custom-devcontainer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·26 lines (22 loc) · 890 Bytes
/
test.sh
File metadata and controls
executable file
·26 lines (22 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
ports=('-p' '5002:8123')
mounts=('-v' "$(pwd)/test:/workspace/test" '-v' "$(pwd)/test/dist:/workspace/dist" '-v' "$(pwd)/test/custom_components:/workspace/custom_components")
environment=('-e' 'LOVELACE_PLUGINS=thomasloven/lovelace-card-mod;dcbr/ha-templated-card;custom-cards/button-card;kalkih/mini-media-player' \
'-e' 'ENV_FILE=/workspace/test/test.env')
mode="run"
if [ "$CODESPACES" == "true" ]; then
# If we are running in a codespace, add this container's ip addresses
# to the trusted proxies list
ips=$(hostname -I)
ips=${ips// /;}
environment=("${environment[@]}" \
'-e' "HASS_TRUSTED_PROXIES=$ips")
fi
if [ "$1" == "dev" ]; then
mode="run-dev"
fi
docker run --rm --name test -it \
"${ports[@]}" \
"${mounts[@]}" \
"${environment[@]}" \
dcbr/hass-custom-devcontainer sudo -E container "$mode"