fix(home-assistant): fix script (#17463)
**Description** <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> ⚒️ Fixes # <!--(issue)--> **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** <!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration --> **📃 Notes:** <!-- Please enter any other relevant information here --> **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
parent
24b4ff2b6e
commit
d7b3683130
|
@ -36,4 +36,4 @@ sources:
|
||||||
- https://github.com/truecharts/charts/tree/master/charts/stable/home-assistant
|
- https://github.com/truecharts/charts/tree/master/charts/stable/home-assistant
|
||||||
- https://hub.docker.com/r/homeassistant/home-assistant
|
- https://hub.docker.com/r/homeassistant/home-assistant
|
||||||
type: application
|
type: application
|
||||||
version: 23.0.8
|
version: 23.0.9
|
||||||
|
|
|
@ -15,7 +15,7 @@ workload:
|
||||||
init:
|
init:
|
||||||
type: init
|
type: init
|
||||||
enabled: true
|
enabled: true
|
||||||
imageSelector: image
|
imageSelector: yqImage
|
||||||
command: /config/init/init.sh
|
command: /config/init/init.sh
|
||||||
# # Enable devices to be discoverable
|
# # Enable devices to be discoverable
|
||||||
# hostNetwork: true
|
# hostNetwork: true
|
||||||
|
@ -51,8 +51,8 @@ configmap:
|
||||||
data:
|
data:
|
||||||
init.sh: |-
|
init.sh: |-
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
{{ $haDBURL := (printf "%s?client_encoding=utf8" (.Values.cnpg.main.creds.std | trimAll "\"")) | quote }}
|
{{- $haDBURL := (printf "%s?client_encoding=utf8" ($.Values.cnpg.main.creds.std | trimAll "\"")) }}
|
||||||
config_file="/config/configuration.yaml"
|
config="/config/configuration.yaml"
|
||||||
default="/config/init"
|
default="/config/init"
|
||||||
if [ ! -f "$config" ]; then
|
if [ ! -f "$config" ]; then
|
||||||
echo "File [$config] does NOT exist. Creating..."
|
echo "File [$config] does NOT exist. Creating..."
|
||||||
|
@ -75,7 +75,7 @@ configmap:
|
||||||
|
|
||||||
echo "Creating include files..."
|
echo "Creating include files..."
|
||||||
for include_file in groups.yaml automations.yaml scripts.yaml scenes.yaml; do
|
for include_file in groups.yaml automations.yaml scripts.yaml scenes.yaml; do
|
||||||
if ! -f "/config/$include_file"; then
|
if [ ! -f "/config/$include_file" ]; then
|
||||||
echo "File [$include_file] missing. Creating"
|
echo "File [$include_file] missing. Creating"
|
||||||
touch "/config/$include_file"
|
touch "/config/$include_file"
|
||||||
fi
|
fi
|
||||||
|
@ -83,7 +83,7 @@ configmap:
|
||||||
|
|
||||||
cd "/config" || echo "Could not change path to /config"
|
cd "/config" || echo "Could not change path to /config"
|
||||||
echo "Creating custom_components directory..."
|
echo "Creating custom_components directory..."
|
||||||
mkdir "/config/custom_components" || echo "custom_components directory already exists"
|
mkdir -p "/config/custom_components" || echo "custom_components directory already exists"
|
||||||
|
|
||||||
echo "Changing to the custom_components directory..."
|
echo "Changing to the custom_components directory..."
|
||||||
cd "/config/custom_components" || echo "Could not change path to /config/custom_components"
|
cd "/config/custom_components" || echo "Could not change path to /config/custom_components"
|
||||||
|
@ -97,7 +97,7 @@ configmap:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Creating HACS directory..."
|
echo "Creating HACS directory..."
|
||||||
mkdir "/config/custom_components/hacs"
|
mkdir -p "/config/custom_components/hacs"
|
||||||
|
|
||||||
echo "Unpacking HACS..."
|
echo "Unpacking HACS..."
|
||||||
unzip "/config/custom_components/hacs.zip" -d "/config/custom_components/hacs" >/dev/null 2>&1
|
unzip "/config/custom_components/hacs.zip" -d "/config/custom_components/hacs" >/dev/null 2>&1
|
||||||
|
|
Loading…
Reference in New Issue