Skip to content

Commit

Permalink
Update base and allow stable/beta/dev (home-assistant#2109)
Browse files Browse the repository at this point in the history
* Update base and allow beta/dev

* typo
  • Loading branch information
ludeeus authored Jul 8, 2021
1 parent ac5fce4 commit 1b2afe2
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 11 deletions.
6 changes: 6 additions & 0 deletions check_config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 3.8.0

- Update base image to 2021.07.0
- Allow using `stable`, `beta` and `dev` as target versions
- Add translation file for English

## 3.7.1

- Update base image to 2021.04.3
Expand Down
6 changes: 5 additions & 1 deletion check_config/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ version: latest

The version of Home Assistant that want to check your configuration against.

Setting this option to `latest` will result in checking your configuration
- Setting this option to `latest` or `stable` will result in checking your configuration
against the latest stable release of Home Assistant.
- Setting this option to `beta` will result in checking your configuration
against the latest beta release of Home Assistant.
- Setting this option to `dev` will result in checking your configuration
against the current dev branch of Home Assistant.

## Known issues and limitations

Expand Down
10 changes: 5 additions & 5 deletions check_config/build.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"build_from": {
"aarch64": "ghcr.io/home-assistant/aarch64-homeassistant-base:2021.04.3",
"amd64": "ghcr.io/home-assistant/amd64-homeassistant-base:2021.04.3",
"armhf": "ghcr.io/home-assistant/armhf-homeassistant-base:2021.04.3",
"armv7": "ghcr.io/home-assistant/armv7-homeassistant-base:2021.04.3",
"i386": "ghcr.io/home-assistant/i386-homeassistant-base:2021.04.3"
"aarch64": "ghcr.io/home-assistant/aarch64-homeassistant-base:2021.07.0",
"amd64": "ghcr.io/home-assistant/amd64-homeassistant-base:2021.07.0",
"armhf": "ghcr.io/home-assistant/armhf-homeassistant-base:2021.07.0",
"armv7": "ghcr.io/home-assistant/armv7-homeassistant-base:2021.07.0",
"i386": "ghcr.io/home-assistant/i386-homeassistant-base:2021.07.0"
}
}
2 changes: 1 addition & 1 deletion check_config/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Check Home Assistant configuration",
"version": "3.7.1",
"version": "3.8.0",
"slug": "check_config",
"description": "Check current Home Assistant configuration against a new version",
"url": "https://github.com/home-assistant/hassio-addons/tree/master/check_config",
Expand Down
16 changes: 12 additions & 4 deletions check_config/rootfs/etc/services.d/check-config/run
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,26 @@
# ==============================================================================
VERSION=$(bashio::config 'version')

CMD_OPTIONS=("--disable-pip-version-check" "--find-links" "${WHEELS_LINKS}")

# Generate install string
CMD="homeassistant"
if [ "${VERSION}" != "latest" ]; then
CMD="homeassistant==${VERSION}"
if [[ "${VERSION}" =~ latest|stable ]]; then
CMD_OPTIONS+=("homeassistant")
elif [ "${VERSION}" == "beta" ]; then
CMD_OPTIONS+=("--pre")
CMD_OPTIONS+=("homeassistant")
elif [ "${VERSION}" == "dev" ]; then
CMD_OPTIONS+=("git+git://github.com/home-assistant/core.git@dev")
else
CMD_OPTIONS+=("homeassistant==${VERSION}")
fi

bashio::log.info "Don't worry, this temporary installation is not overwriting your current one."
bashio::log.info "Installing Home Assistant: ${VERSION}..."
bashio::log.info "Please be patient, this might take a few minutes..."

# Install Home Assistant with the requested version
if ! PIP_OUTPUT="$(pip3 install --disable-pip-version-check --find-links "${WHEELS_LINKS}" "${CMD}" 2>&1)"; then
if ! PIP_OUTPUT=$(pip3 install "${CMD_OPTIONS[@]}" 2>&1); then
bashio::log.error "An error occurred while installing Home Assistant:"
bashio::log "${PIP_OUTPUT}"
bashio::exit.nok
Expand Down
4 changes: 4 additions & 0 deletions check_config/translations/en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
configuration:
version:
name: Version
description: The version of Home Assistant to check against, you can use `stable` , `latest`, `dev` and a version

0 comments on commit 1b2afe2

Please sign in to comment.