mirror of
https://github.com/lildude/ha-addon-teslamate.git
synced 2026-10-13 21:19:16 -04:00
Update integration tests and update dev environment (#152)
This commit is contained in:
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