mirror of
https://github.com/lildude/ha-addon-teslamate.git
synced 2026-12-05 15:24:38 -05:00
Update integration tests and update dev environment (#152)
This commit is contained in:
1 parent
b21b77c5b0
commit
932352d43a
7 files changed
+333
-316
No files matched your search
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
# Remove an add-on's registry image before the Supervisor starts so it must
|
||||
# build the current checkout's Dockerfile.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
config="${1:-config.json}"
|
||||
|
||||
if [ ! -f "$config" ]; then
|
||||
echo "ERROR: Add-on config not found: ${config}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! jq empty "$config"; then
|
||||
echo "ERROR: Invalid add-on config: ${config}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if jq -e 'has("image")' "$config" > /dev/null; then
|
||||
temporary_config=$(mktemp "${config}.XXXXXX")
|
||||
trap 'rm -f "$temporary_config"' EXIT
|
||||
|
||||
jq 'del(.image)' "$config" > "$temporary_config"
|
||||
mv "$temporary_config" "$config"
|
||||
fi
|
||||
|
||||
if jq -e 'has("image")' "$config" > /dev/null; then
|
||||
echo "ERROR: Failed to remove image from ${config}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Registry image disabled; the Supervisor will build the current checkout"
|
||||
Reference in new issue
Block a user