Streamline version handling (#2155)
* Streamline version handling * guard detached add-on * commit version * fix version * Update pipeline * use su-version * Handle core like before * Fix dev * Update supervisor/api/addons.py Co-authored-by: Joakim Sørensen <joasoe@gmail.com> * Cleanup * Fix format * fix import * fix yml issue * fix readme * Update supervisor/api/addons.py Co-authored-by: Joakim Sørensen <joasoe@gmail.com> * Update frontend * Address comments Co-authored-by: Joakim Sørensen <joasoe@gmail.com> Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
This commit is contained in:
parent
b513512551
commit
f2843db421
|
@ -24,3 +24,12 @@ The development of the Supervisor is not difficult but tricky.
|
|||
- Test your changes
|
||||
|
||||
For small bugfixes or improvements, make a PR. For significant changes open a RFC first, please. Thanks.
|
||||
|
||||
## Release
|
||||
|
||||
Follow is the relase circle process:
|
||||
|
||||
1. Merge master into dev / make sure version stay on dev
|
||||
2. Merge dev into master
|
||||
3. Bump the release on master
|
||||
4. Create a GitHub Release from master with the right version tag
|
||||
|
|
|
@ -11,43 +11,90 @@ trigger:
|
|||
pr: none
|
||||
variables:
|
||||
- name: versionBuilder
|
||||
value: "7.0"
|
||||
value: "7.2.0"
|
||||
- group: docker
|
||||
resources:
|
||||
repositories:
|
||||
- repository: azure
|
||||
type: github
|
||||
name: "home-assistant/ci-azure"
|
||||
endpoint: "home-assistant"
|
||||
|
||||
jobs:
|
||||
- job: "VersionValidate"
|
||||
pool:
|
||||
vmImage: "ubuntu-latest"
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
displayName: "Use Python 3.8"
|
||||
inputs:
|
||||
versionSpec: "3.8"
|
||||
- script: |
|
||||
setup_version="$(python setup.py -V)"
|
||||
branch_version="$(Build.SourceBranchName)"
|
||||
stages:
|
||||
- stage: "Validate"
|
||||
jobs:
|
||||
- template: templates/azp-job-version.yaml@azure
|
||||
parameters:
|
||||
ignoreDev: true
|
||||
|
||||
if [ "${branch_version}" == "dev" ]; then
|
||||
exit 0
|
||||
elif [ "${setup_version}" != "${branch_version}" ]; then
|
||||
echo "Version of tag ${branch_version} don't match with ${setup_version}!"
|
||||
exit 1
|
||||
fi
|
||||
displayName: "Check version of branch/tag"
|
||||
- job: "Release"
|
||||
dependsOn:
|
||||
- "VersionValidate"
|
||||
pool:
|
||||
vmImage: "ubuntu-latest"
|
||||
steps:
|
||||
- script: sudo docker login -u $(dockerUser) -p $(dockerPassword)
|
||||
displayName: "Docker hub login"
|
||||
- script: sudo docker pull homeassistant/amd64-builder:$(versionBuilder)
|
||||
displayName: "Install Builder"
|
||||
- script: |
|
||||
sudo docker run --rm --privileged \
|
||||
-v ~/.docker:/root/.docker \
|
||||
-v /run/docker.sock:/run/docker.sock:rw -v $(pwd):/data:ro \
|
||||
homeassistant/amd64-builder:$(versionBuilder) \
|
||||
--generic $(Build.SourceBranchName) --all -t /data
|
||||
displayName: "Build Release"
|
||||
- stage: "Build"
|
||||
jobs:
|
||||
- job: "ReleaseDocker"
|
||||
timeoutInMinutes: 240
|
||||
pool:
|
||||
vmImage: "ubuntu-latest"
|
||||
strategy:
|
||||
maxParallel: 5
|
||||
matrix:
|
||||
amd64:
|
||||
buildArch: "amd64"
|
||||
i386:
|
||||
buildArch: "i386"
|
||||
armhf:
|
||||
buildArch: "armhf"
|
||||
armv7:
|
||||
buildArch: "armv7"
|
||||
aarch64:
|
||||
buildArch: "aarch64"
|
||||
steps:
|
||||
- template: templates/azp-step-su-version.yaml@azure
|
||||
- script: |
|
||||
docker login -u $(dockerUser) -p $(dockerPassword)
|
||||
displayName: "Docker hub login"
|
||||
- script: docker pull homeassistant/amd64-builder:$(versionBuilder)
|
||||
displayName: "Install Builder"
|
||||
- script: |
|
||||
sudo docker run --rm --privileged \
|
||||
-v ~/.docker:/root/.docker \
|
||||
-v /run/docker.sock:/run/docker.sock:rw -v $(pwd):/data:ro \
|
||||
homeassistant/amd64-builder:$(versionBuilder) \
|
||||
--generic $(supervisorRelease) "--$(buildArch)" -t /data
|
||||
displayName: "Build Release"
|
||||
|
||||
- stage: "Publish"
|
||||
jobs:
|
||||
- job: "ReleaseHassio"
|
||||
pool:
|
||||
vmImage: "ubuntu-latest"
|
||||
steps:
|
||||
- template: templates/azp-step-su-version.yaml@azure
|
||||
- script: |
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
git jq curl
|
||||
|
||||
git config --global user.name "Pascal Vizeli"
|
||||
git config --global user.email "pvizeli@syshack.ch"
|
||||
git config --global credential.helper store
|
||||
|
||||
echo "https://$(githubToken):x-oauth-basic@github.com" > $HOME/.git-credentials
|
||||
displayName: "Install requirements"
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
version="$(supervisorRelease)"
|
||||
|
||||
git clone https://github.com/home-assistant/hassio-version
|
||||
cd hassio-version
|
||||
|
||||
dev_version="$(jq --raw-output '.supervisor' dev.json)"
|
||||
beta_version="$(jq --raw-output '.supervisor' beta.json)"
|
||||
|
||||
if [[ "$version" =~ dev ]]; then
|
||||
sed -i "s|\"supervisor\": \"$dev_version\"|\"supervisor\": \"$version\"|g" dev.json
|
||||
else
|
||||
sed -i "s|\"supervisor\": \"$beta_version\"|\"supervisor\": \"$version\"|g" beta.json
|
||||
fi
|
||||
|
||||
git commit -am "Bump Supervisor $version"
|
||||
git push
|
||||
displayName: "Update version files"
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit eec4a91ad8c3f8904c5c3dc5996946977988d0e1
|
||||
Subproject commit 01b9a0732053b2a1a0d6de7c0c795087a88752d7
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
set -eE
|
||||
|
||||
commit_count="$(git rev-list --count --since=yesterday HEAD)"
|
||||
calver_date="$(date "+%Y.%m.dev%d")"
|
||||
|
||||
calver_version="${setup_version}.dev${calver_date}${commit_count}"
|
||||
|
||||
sed -i "s/SUPERVISOR_VERSION .*/SUPERVISOR_VERSION = \"${calver_version}\"/g" supervisor/const.py
|
||||
echo "$calver_version"
|
|
@ -149,6 +149,13 @@ class Addon(AddonModel):
|
|||
"""Return installed version."""
|
||||
return self.persist[ATTR_VERSION]
|
||||
|
||||
@property
|
||||
def need_update(self) -> bool:
|
||||
"""Return True if an update is available."""
|
||||
if self.is_detached:
|
||||
return False
|
||||
return self.version != self.latest_version
|
||||
|
||||
@property
|
||||
def dns(self) -> List[str]:
|
||||
"""Return list of DNS name for that add-on."""
|
||||
|
|
|
@ -83,6 +83,7 @@ from ..const import (
|
|||
ATTR_STATE,
|
||||
ATTR_STDIN,
|
||||
ATTR_UDEV,
|
||||
ATTR_UPDATE_AVAILABLE,
|
||||
ATTR_URL,
|
||||
ATTR_USB,
|
||||
ATTR_VALID,
|
||||
|
@ -161,8 +162,12 @@ class APIAddons(CoreSysAttributes):
|
|||
ATTR_DESCRIPTON: addon.description,
|
||||
ATTR_ADVANCED: addon.advanced,
|
||||
ATTR_STAGE: addon.stage,
|
||||
ATTR_VERSION: addon.latest_version,
|
||||
ATTR_INSTALLED: addon.version if addon.is_installed else None,
|
||||
ATTR_VERSION: addon.version if addon.is_installed else None,
|
||||
ATTR_VERSION_LATEST: addon.latest_version,
|
||||
ATTR_UPDATE_AVAILABLE: addon.need_update
|
||||
if addon.is_installed
|
||||
else False,
|
||||
ATTR_INSTALLED: addon.is_installed,
|
||||
ATTR_AVAILABLE: addon.available,
|
||||
ATTR_DETACHED: addon.is_detached,
|
||||
ATTR_REPOSITORY: addon.repository,
|
||||
|
@ -209,6 +214,7 @@ class APIAddons(CoreSysAttributes):
|
|||
ATTR_REPOSITORY: addon.repository,
|
||||
ATTR_VERSION: None,
|
||||
ATTR_VERSION_LATEST: addon.latest_version,
|
||||
ATTR_UPDATE_AVAILABLE: False,
|
||||
ATTR_PROTECTED: addon.protected,
|
||||
ATTR_RATING: rating_security(addon),
|
||||
ATTR_BOOT: addon.boot,
|
||||
|
@ -278,6 +284,7 @@ class APIAddons(CoreSysAttributes):
|
|||
ATTR_AUTO_UPDATE: addon.auto_update,
|
||||
ATTR_IP_ADDRESS: str(addon.ip_address),
|
||||
ATTR_VERSION: addon.version,
|
||||
ATTR_UPDATE_AVAILABLE: addon.need_update,
|
||||
ATTR_WATCHDOG: addon.watchdog,
|
||||
}
|
||||
)
|
||||
|
|
|
@ -25,6 +25,7 @@ from ..const import (
|
|||
ATTR_NETWORK_RX,
|
||||
ATTR_NETWORK_TX,
|
||||
ATTR_OUTPUT,
|
||||
ATTR_UPDATE_AVAILABLE,
|
||||
ATTR_VERSION,
|
||||
ATTR_VERSION_LATEST,
|
||||
ATTR_VOLUME,
|
||||
|
@ -71,6 +72,7 @@ class APIAudio(CoreSysAttributes):
|
|||
return {
|
||||
ATTR_VERSION: self.sys_plugins.audio.version,
|
||||
ATTR_VERSION_LATEST: self.sys_plugins.audio.latest_version,
|
||||
ATTR_UPDATE_AVAILABLE: self.sys_plugins.audio.need_update,
|
||||
ATTR_HOST: str(self.sys_docker.network.audio),
|
||||
ATTR_AUDIO: {
|
||||
ATTR_CARD: [attr.asdict(card) for card in self.sys_host.sound.cards],
|
||||
|
|
|
@ -15,6 +15,7 @@ from ..const import (
|
|||
ATTR_MEMORY_USAGE,
|
||||
ATTR_NETWORK_RX,
|
||||
ATTR_NETWORK_TX,
|
||||
ATTR_UPDATE_AVAILABLE,
|
||||
ATTR_VERSION,
|
||||
ATTR_VERSION_LATEST,
|
||||
)
|
||||
|
@ -36,6 +37,7 @@ class APICli(CoreSysAttributes):
|
|||
return {
|
||||
ATTR_VERSION: self.sys_plugins.cli.version,
|
||||
ATTR_VERSION_LATEST: self.sys_plugins.cli.latest_version,
|
||||
ATTR_UPDATE_AVAILABLE: self.sys_plugins.cli.need_update,
|
||||
}
|
||||
|
||||
@api_process
|
||||
|
|
|
@ -18,6 +18,7 @@ from ..const import (
|
|||
ATTR_NETWORK_RX,
|
||||
ATTR_NETWORK_TX,
|
||||
ATTR_SERVERS,
|
||||
ATTR_UPDATE_AVAILABLE,
|
||||
ATTR_VERSION,
|
||||
ATTR_VERSION_LATEST,
|
||||
CONTENT_TYPE_BINARY,
|
||||
|
@ -44,6 +45,7 @@ class APICoreDNS(CoreSysAttributes):
|
|||
return {
|
||||
ATTR_VERSION: self.sys_plugins.dns.version,
|
||||
ATTR_VERSION_LATEST: self.sys_plugins.dns.latest_version,
|
||||
ATTR_UPDATE_AVAILABLE: self.sys_plugins.dns.need_update,
|
||||
ATTR_HOST: str(self.sys_docker.network.dns),
|
||||
ATTR_SERVERS: self.sys_plugins.dns.servers,
|
||||
ATTR_LOCALS: self.sys_host.network.dns_servers,
|
||||
|
|
|
@ -25,6 +25,7 @@ from ..const import (
|
|||
ATTR_PORT,
|
||||
ATTR_REFRESH_TOKEN,
|
||||
ATTR_SSL,
|
||||
ATTR_UPDATE_AVAILABLE,
|
||||
ATTR_VERSION,
|
||||
ATTR_VERSION_LATEST,
|
||||
ATTR_WAIT_BOOT,
|
||||
|
@ -65,6 +66,7 @@ class APIHomeAssistant(CoreSysAttributes):
|
|||
return {
|
||||
ATTR_VERSION: self.sys_homeassistant.version,
|
||||
ATTR_VERSION_LATEST: self.sys_homeassistant.latest_version,
|
||||
ATTR_UPDATE_AVAILABLE: self.sys_homeassistant.need_update,
|
||||
ATTR_MACHINE: self.sys_homeassistant.machine,
|
||||
ATTR_IP_ADDRESS: str(self.sys_homeassistant.ip_address),
|
||||
ATTR_ARCH: self.sys_homeassistant.arch,
|
||||
|
|
|
@ -15,6 +15,7 @@ from ..const import (
|
|||
ATTR_MEMORY_USAGE,
|
||||
ATTR_NETWORK_RX,
|
||||
ATTR_NETWORK_TX,
|
||||
ATTR_UPDATE_AVAILABLE,
|
||||
ATTR_VERSION,
|
||||
ATTR_VERSION_LATEST,
|
||||
CONTENT_TYPE_BINARY,
|
||||
|
@ -38,6 +39,7 @@ class APIMulticast(CoreSysAttributes):
|
|||
return {
|
||||
ATTR_VERSION: self.sys_plugins.multicast.version,
|
||||
ATTR_VERSION_LATEST: self.sys_plugins.multicast.latest_version,
|
||||
ATTR_UPDATE_AVAILABLE: self.sys_plugins.multicast.need_update,
|
||||
}
|
||||
|
||||
@api_process
|
||||
|
|
|
@ -16,6 +16,7 @@ from ..const import (
|
|||
ATTR_MEMORY_USAGE,
|
||||
ATTR_NETWORK_RX,
|
||||
ATTR_NETWORK_TX,
|
||||
ATTR_UPDATE_AVAILABLE,
|
||||
ATTR_VERSION,
|
||||
ATTR_VERSION_LATEST,
|
||||
)
|
||||
|
@ -38,6 +39,7 @@ class APIObserver(CoreSysAttributes):
|
|||
ATTR_HOST: str(self.sys_docker.network.observer),
|
||||
ATTR_VERSION: self.sys_plugins.observer.version,
|
||||
ATTR_VERSION_LATEST: self.sys_plugins.observer.latest_version,
|
||||
ATTR_UPDATE_AVAILABLE: self.sys_plugins.observer.need_update,
|
||||
}
|
||||
|
||||
@api_process
|
||||
|
|
|
@ -6,7 +6,13 @@ from typing import Any, Awaitable, Dict
|
|||
from aiohttp import web
|
||||
import voluptuous as vol
|
||||
|
||||
from ..const import ATTR_BOARD, ATTR_BOOT, ATTR_VERSION, ATTR_VERSION_LATEST
|
||||
from ..const import (
|
||||
ATTR_BOARD,
|
||||
ATTR_BOOT,
|
||||
ATTR_UPDATE_AVAILABLE,
|
||||
ATTR_VERSION,
|
||||
ATTR_VERSION_LATEST,
|
||||
)
|
||||
from ..coresys import CoreSysAttributes
|
||||
from ..validate import version_tag
|
||||
from .utils import api_process, api_validate
|
||||
|
@ -25,6 +31,7 @@ class APIOS(CoreSysAttributes):
|
|||
return {
|
||||
ATTR_VERSION: self.sys_hassos.version,
|
||||
ATTR_VERSION_LATEST: self.sys_hassos.latest_version,
|
||||
ATTR_UPDATE_AVAILABLE: self.sys_hassos.need_update,
|
||||
ATTR_BOARD: self.sys_hassos.board,
|
||||
ATTR_BOOT: self.sys_dbus.rauc.boot_slot,
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
try {
|
||||
new Function("import('/api/hassio/app/frontend_latest/entrypoint.f7e7035c.js')")();
|
||||
new Function("import('/api/hassio/app/frontend_latest/entrypoint.00c1195f.js')")();
|
||||
} catch (err) {
|
||||
var el = document.createElement('script');
|
||||
el.src = '/api/hassio/app/frontend_es5/entrypoint.c862ef13.js';
|
||||
el.src = '/api/hassio/app/frontend_es5/entrypoint.1d118c6f.js';
|
||||
document.body.appendChild(el);
|
||||
}
|
||||
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"chunk.432a05023856cbf23e99.js","sources":["webpack://home-assistant-frontend/chunk.432a05023856cbf23e99.js"],"mappings":"AAAA","sourceRoot":""}
|
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"chunk.b3f75e68bf3aecce0738.js","sources":["webpack://home-assistant-frontend/chunk.b3f75e68bf3aecce0738.js"],"mappings":"AAAA","sourceRoot":""}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"chunk.d35bb94c5d9d38fdb32d.js","sources":["webpack://home-assistant-frontend/chunk.d35bb94c5d9d38fdb32d.js"],"mappings":"AAAA","sourceRoot":""}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"chunk.f96173219a8da57b538f.js","sources":["webpack://home-assistant-frontend/chunk.f96173219a8da57b538f.js"],"mappings":"AAAA","sourceRoot":""}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"entrypoint.1d118c6f.js","sources":["webpack://home-assistant-frontend/entrypoint.1d118c6f.js"],"mappings":";AAAA","sourceRoot":""}
|
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"entrypoint.c862ef13.js","sources":["webpack://home-assistant-frontend/entrypoint.c862ef13.js"],"mappings":";AAAA","sourceRoot":""}
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"entrypoint.js": "/api/hassio/app/frontend_es5/entrypoint.c862ef13.js"
|
||||
"entrypoint.js": "/api/hassio/app/frontend_es5/entrypoint.1d118c6f.js"
|
||||
}
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1 +1 @@
|
|||
{"version":3,"file":"chunk.2fb2417488a6c7184d5f.js","sources":["webpack://home-assistant-frontend/chunk.2fb2417488a6c7184d5f.js"],"mappings":"AAAA;;;AAyMA;AACA;;;AAGA;;;;;AAKA;;AAEA;AAEA;AACA;;;;;;;AAQA;;;;;AAKA;;AAEA;AAEA;AACA;;;;;;;AAQA;;;;;AAOA;;;;;;;;;;;;;;;;AAuBA;AAymBA;;AAEA;;AAEA;AACA;;AAIA;AA0JA;;;;AAIA;;AAEA;AACA;;;AAGA;;;;AAIA;AACA;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;AA6HA;;;AAyGA;AACA;;;;;;;;AAQA;;AAGA;;;AAGA;;AAEA;AACA;;;;AAIA;;;;;;;AAQA;;;AAGA;;;;;AAvCA;;;;;;;;;;;;;;;AA8KA;;;AA+EA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AApBA;;;;;;;;;;;AA4CA;;;AAwGA;;AAEA;;;;AARA;;;;;;;;;;;;AAiCA;;AAwBA;AACA;AACA;;;AAMA;;;;AA0IA;;;AAMA;AACA;;;AAGA;;AAEA;;AAKA;;AAEA;;AAEA;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA;AAiLA;;;;AAIA;AACA;AACA;AACA;;;AAGA;;;;;;;;AAQA;AACA;AACA;;;;AAIA;AACA;;;AAGA;;;AAGA;AACA;;;;;;;AAOA;;;;;;;;;AASA;;AAEA;AACA;;;;AAIA;;AAEA;;;;AAIA;;;AAGA;;;;AAIA;AACA;AACA;;;AAGA;;;;;;AAMA;;AAEA;AACA;;;;AAIA;;;AAGA;;AAEA;;AAEA;AACA;AAIA;;;;;;AAMA;;AAEA;AACA;;AAEA;AAKA;;AAEA;;;;AAIA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;;;AAGA;;AAEA;;AAEA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;AACA;;;;;AAKA;;AAEA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;;;;;;AAMA;;;AAGA;;;AAGA;;AAEA;;;;;;;;AAQA;AACA;;;;;AAKA;AACA;;;;;;;;AAQA;AACA;;;;AAIA;AACA;AACA;;;;;;;;;AASA;AACA;;;;AAIA;AACA;AACA;;;;;AAKA;;;AAGA;AACA;AACA;;;;AAIA;AACA;AACA;;;;;;;;AAQA;AACA;;;;AAIA;;AAEA;AACA;;;AAGA;AACA;;;AAGA;AACA;;;;;;AAMA;AACA;;;;AAIA;AACA;;;;AAIA;;AAEA;;;;;;;;;;AAUA;AACA;AACA;;;AAGA;;;AAGA;;;;AAIA;;;AAGA;AACA;;;;AAIA;AACA;AACA;;;;;;AAMA;AACA;;;;;;;;AAQA;;;;AAIA;;;;AAIA;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAocA;;;AAoFA;AACA;AACA;;;AARA;;;;;;AA4BA;AAkGA;;AAEA;;AAEA;AACA;AACA;;;AAGA;;;AAKA;;;;;;;;;AAgBA;;;AAiGA;AACA;;;AAPA;;;;;;AA2BA;;AAmQA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA","sourceRoot":""}
|
||||
{"version":3,"file":"chunk.8b992d93a69751270118.js","sources":["webpack://home-assistant-frontend/chunk.8b992d93a69751270118.js"],"mappings":"AAAA;;;AAyMA;AACA;;;AAGA;;;;;AAKA;;AAEA;AAEA;AACA;;;;;;;AAQA;;;;;AAKA;;AAEA;AAEA;AACA;;;;;;;AAQA;;;;;AAOA;;;;;;;;;;;;;;;;AAuBA;AAymBA;;AAEA;;AAEA;AACA;;AAIA;AA0JA;;;;AAIA;;AAEA;AACA;;;AAGA;;;;AAIA;AACA;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;AA6HA;;;AAyGA;AACA;;;;;;;;AAQA;;AAGA;;;AAGA;;AAEA;AACA;;;;AAIA;;;;;;;AAQA;;;AAGA;;;;;AAvCA;;;;;;;;;;;;;;;AA8KA;;;AA+EA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AApBA;;;;;;;;;;;AA4CA;;;AAwGA;;AAEA;;;;AARA;;;;;;;;;;;;AAiCA;;AAwBA;AACA;AACA;;;AAMA;;;;AA0IA;;;AAMA;AACA;;;AAGA;;AAEA;;AAKA;;AAEA;;AAEA;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA;AAiLA;;;;AAIA;AACA;AACA;AACA;;;AAGA;;;;;;;;AAQA;AACA;AACA;;;;AAIA;AACA;;;AAGA;;;AAGA;AACA;;;;;;;AAOA;;;;;;;;;AASA;;AAEA;AACA;;;;AAIA;;AAEA;;;;AAIA;;;AAGA;;;;AAIA;AACA;AACA;;;AAGA;;;;;;AAMA;;AAEA;AACA;;;;AAIA;;;AAGA;;AAEA;;AAEA;AACA;AAIA;;;;;;AAMA;;AAEA;AACA;;AAEA;AAKA;;AAEA;;;;AAIA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;;;AAGA;;AAEA;;AAEA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;AACA;;;;;AAKA;;AAEA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;AAEA;;;;;;AAMA;;;AAGA;;;AAGA;;AAEA;;;;;;;;AAQA;AACA;;;;;AAKA;AACA;;;;;;;;AAQA;AACA;;;;AAIA;AACA;AACA;;;;;;;;;AASA;AACA;;;;AAIA;AACA;AACA;;;;;AAKA;;;AAGA;AACA;AACA;;;;AAIA;AACA;AACA;;;;;;;;AAQA;AACA;;;;AAIA;;AAEA;AACA;;;AAGA;AACA;;;AAGA;AACA;;;;;;AAMA;AACA;;;;AAIA;AACA;;;;AAIA;;AAEA;;;;;;;;;;AAUA;AACA;AACA;;;AAGA;;;AAGA;;;;AAIA;;;AAGA;AACA;;;;AAIA;AACA;AACA;;;;;;AAMA;AACA;;;;;;;;AAQA;;;;AAIA;;;;AAIA;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8bA;;;AAoFA;AACA;AACA;;;AARA;;;;;;AA4BA;AAkGA;;AAEA;;AAEA;AACA;AACA;;;AAGA;;;AAKA;;;;;;;;;AAgBA;;;AAiGA;AACA;;;AAPA;;;;;;AA2BA;;AAmQA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA","sourceRoot":""}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"chunk.bf19c8c8b581bf12cb44.js","sources":["webpack://home-assistant-frontend/chunk.bf19c8c8b581bf12cb44.js"],"mappings":"AAAA;;;AA6HA;AACA;AACA;;AAEA;;;AAGA;;AAEA;;AAKA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;AAIA;AACA;;;AAGA;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA","sourceRoot":""}
|
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"chunk.f7c3ad6c28d70dd4b039.js","sources":["webpack://home-assistant-frontend/chunk.f7c3ad6c28d70dd4b039.js"],"mappings":"AAAA;;;AA6HA;AACA;AACA;;AAEA;;;AAGA;;AAEA;;AAIA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;AAIA;AACA;;;AAGA;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;AA4FA","sourceRoot":""}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"entrypoint.js": "/api/hassio/app/frontend_latest/entrypoint.f7e7035c.js"
|
||||
"entrypoint.js": "/api/hassio/app/frontend_latest/entrypoint.00c1195f.js"
|
||||
}
|
|
@ -20,7 +20,6 @@ from ..const import (
|
|||
ATTR_DIAGNOSTICS,
|
||||
ATTR_HEALTHY,
|
||||
ATTR_ICON,
|
||||
ATTR_INSTALLED,
|
||||
ATTR_IP_ADDRESS,
|
||||
ATTR_LOGGING,
|
||||
ATTR_LOGO,
|
||||
|
@ -35,11 +34,11 @@ from ..const import (
|
|||
ATTR_STATE,
|
||||
ATTR_SUPPORTED,
|
||||
ATTR_TIMEZONE,
|
||||
ATTR_UPDATE_AVAILABLE,
|
||||
ATTR_VERSION,
|
||||
ATTR_VERSION_LATEST,
|
||||
ATTR_WAIT_BOOT,
|
||||
CONTENT_TYPE_BINARY,
|
||||
SUPERVISOR_VERSION,
|
||||
LogLevel,
|
||||
UpdateChannel,
|
||||
)
|
||||
|
@ -87,8 +86,9 @@ class APISupervisor(CoreSysAttributes):
|
|||
ATTR_SLUG: addon.slug,
|
||||
ATTR_DESCRIPTON: addon.description,
|
||||
ATTR_STATE: addon.state,
|
||||
ATTR_VERSION: addon.latest_version,
|
||||
ATTR_INSTALLED: addon.version,
|
||||
ATTR_VERSION: addon.version,
|
||||
ATTR_VERSION_LATEST: addon.latest_version,
|
||||
ATTR_UPDATE_AVAILABLE: addon.need_update,
|
||||
ATTR_REPOSITORY: addon.repository,
|
||||
ATTR_ICON: addon.with_icon,
|
||||
ATTR_LOGO: addon.with_logo,
|
||||
|
@ -96,8 +96,9 @@ class APISupervisor(CoreSysAttributes):
|
|||
)
|
||||
|
||||
return {
|
||||
ATTR_VERSION: SUPERVISOR_VERSION,
|
||||
ATTR_VERSION_LATEST: self.sys_updater.version_supervisor,
|
||||
ATTR_VERSION: self.sys_supervisor.version,
|
||||
ATTR_VERSION_LATEST: self.sys_supervisor.latest_version,
|
||||
ATTR_UPDATE_AVAILABLE: self.sys_supervisor.need_update,
|
||||
ATTR_CHANNEL: self.sys_updater.channel,
|
||||
ATTR_ARCH: self.sys_supervisor.arch,
|
||||
ATTR_SUPPORTED: self.sys_core.supported,
|
||||
|
|
|
@ -16,7 +16,6 @@ from .arch import CpuArch
|
|||
from .auth import Auth
|
||||
from .const import (
|
||||
ENV_HOMEASSISTANT_REPOSITORY,
|
||||
ENV_SUPERVISOR_DEV,
|
||||
ENV_SUPERVISOR_MACHINE,
|
||||
ENV_SUPERVISOR_NAME,
|
||||
ENV_SUPERVISOR_SHARE,
|
||||
|
@ -180,7 +179,7 @@ def initialize_system_data(coresys: CoreSys) -> None:
|
|||
coresys.config.modify_log_level()
|
||||
|
||||
# Check if ENV is in development mode
|
||||
if bool(os.environ.get(ENV_SUPERVISOR_DEV, 0)):
|
||||
if coresys.dev:
|
||||
_LOGGER.warning("Environment variables 'SUPERVISOR_DEV' is set")
|
||||
coresys.updater.channel = UpdateChannel.DEV
|
||||
coresys.config.logging = LogLevel.DEBUG
|
||||
|
|
|
@ -3,7 +3,7 @@ from enum import Enum
|
|||
from ipaddress import ip_network
|
||||
from pathlib import Path
|
||||
|
||||
SUPERVISOR_VERSION = "250"
|
||||
SUPERVISOR_VERSION = "DEV"
|
||||
|
||||
URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons"
|
||||
URL_HASSIO_APPARMOR = "https://version.home-assistant.io/apparmor.txt"
|
||||
|
@ -280,6 +280,7 @@ ATTR_WAIT_BOOT = "wait_boot"
|
|||
ATTR_WATCHDOG = "watchdog"
|
||||
ATTR_WEBUI = "webui"
|
||||
ATTR_OBSERVER = "observer"
|
||||
ATTR_UPDATE_AVAILABLE = "update_available"
|
||||
|
||||
PROVIDE_SERVICE = "provide"
|
||||
NEED_SERVICE = "need"
|
||||
|
|
|
@ -97,15 +97,6 @@ class Core(CoreSysAttributes):
|
|||
# Check supervisor version/update
|
||||
if self.sys_dev:
|
||||
self.sys_config.version = self.sys_supervisor.version
|
||||
elif (
|
||||
self.sys_config.version == "dev"
|
||||
or self.sys_supervisor.instance.version == "dev"
|
||||
):
|
||||
self.healthy = False
|
||||
_LOGGER.warning(
|
||||
"Found a development Supervisor outside dev channel (%s)",
|
||||
self.sys_updater.channel,
|
||||
)
|
||||
elif self.sys_config.version != self.sys_supervisor.version:
|
||||
self.sys_resolution.create_issue(
|
||||
IssueType.UPDATE_ROLLBACK, ContextType.SUPERVISOR
|
||||
|
@ -219,7 +210,7 @@ class Core(CoreSysAttributes):
|
|||
# On release channel, try update itself
|
||||
if self.sys_supervisor.need_update:
|
||||
try:
|
||||
if self.sys_dev or not self.healthy:
|
||||
if not self.healthy:
|
||||
_LOGGER.warning("Ignoring Supervisor updates!")
|
||||
else:
|
||||
await self.sys_supervisor.update()
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
from typing import TYPE_CHECKING, Any, Callable, Coroutine, Optional, TypeVar
|
||||
|
||||
import aiohttp
|
||||
import sentry_sdk
|
||||
|
||||
from .config import CoreConfig
|
||||
from .const import UpdateChannel
|
||||
from .const import ENV_SUPERVISOR_DEV
|
||||
from .docker import DockerAPI
|
||||
from .misc.hardware import Hardware
|
||||
|
||||
|
@ -86,9 +87,7 @@ class CoreSys:
|
|||
@property
|
||||
def dev(self) -> bool:
|
||||
"""Return True if we run dev mode."""
|
||||
if self._updater is None:
|
||||
return False
|
||||
return self._updater.channel == UpdateChannel.DEV
|
||||
return bool(os.environ.get(ENV_SUPERVISOR_DEV, 0))
|
||||
|
||||
@property
|
||||
def loop(self) -> asyncio.BaseEventLoop:
|
||||
|
|
|
@ -6,6 +6,7 @@ from typing import Awaitable, Optional
|
|||
|
||||
import aiohttp
|
||||
from cpe import CPE
|
||||
from packaging.version import parse as pkg_parse
|
||||
|
||||
from .const import URL_HASSOS_OTA
|
||||
from .coresys import CoreSys, CoreSysAttributes
|
||||
|
@ -43,7 +44,10 @@ class HassOS(CoreSysAttributes):
|
|||
@property
|
||||
def need_update(self) -> bool:
|
||||
"""Return true if a HassOS update is available."""
|
||||
return self.version != self.latest_version
|
||||
try:
|
||||
return pkg_parse(self.version) < pkg_parse(self.latest_version)
|
||||
except (TypeError, ValueError):
|
||||
return True
|
||||
|
||||
@property
|
||||
def board(self) -> Optional[str]:
|
||||
|
|
|
@ -217,6 +217,11 @@ class HomeAssistant(JsonConfig, CoreSysAttributes):
|
|||
"""Set audio input settings."""
|
||||
self._data[ATTR_AUDIO_INPUT] = value
|
||||
|
||||
@property
|
||||
def need_update(self) -> bool:
|
||||
"""Return true if a Home Assistant update is available."""
|
||||
return self.version != self.latest_version
|
||||
|
||||
async def load(self) -> None:
|
||||
"""Prepare Home Assistant object."""
|
||||
await asyncio.wait([self.secrets.load(), self.core.load()])
|
||||
|
|
|
@ -4,7 +4,7 @@ import re
|
|||
|
||||
from aiohttp import hdrs
|
||||
|
||||
from ..const import ENV_SUPERVISOR_DEV, HEADER_TOKEN_OLD, CoreState
|
||||
from ..const import HEADER_TOKEN_OLD, CoreState
|
||||
from ..coresys import CoreSys
|
||||
from ..exceptions import AddonConfigurationError
|
||||
|
||||
|
@ -22,8 +22,6 @@ def sanitize_url(url: str) -> str:
|
|||
|
||||
def filter_data(coresys: CoreSys, event: dict, hint: dict) -> dict:
|
||||
"""Filter event data before sending to sentry."""
|
||||
dev_env: bool = bool(os.environ.get(ENV_SUPERVISOR_DEV, 0))
|
||||
|
||||
# Ignore some exceptions
|
||||
if "exc_info" in hint:
|
||||
_, exc_value, _ = hint["exc_info"]
|
||||
|
@ -31,7 +29,7 @@ def filter_data(coresys: CoreSys, event: dict, hint: dict) -> dict:
|
|||
return None
|
||||
|
||||
# Ignore issue if system is not supported or diagnostics is disabled
|
||||
if not coresys.config.diagnostics or not coresys.core.supported or dev_env:
|
||||
if not coresys.config.diagnostics or not coresys.core.supported or coresys.dev:
|
||||
return None
|
||||
|
||||
event.setdefault("extra", {}).update({"os.environ": dict(os.environ)})
|
||||
|
|
|
@ -120,7 +120,7 @@ class Tasks(CoreSysAttributes):
|
|||
continue
|
||||
|
||||
# Evaluate available updates
|
||||
if addon.version == addon.latest_version:
|
||||
if not addon.need_update:
|
||||
continue
|
||||
if not addon.test_update_schema():
|
||||
_LOGGER.warning(
|
||||
|
@ -128,6 +128,7 @@ class Tasks(CoreSysAttributes):
|
|||
)
|
||||
continue
|
||||
|
||||
# Check free space
|
||||
if self.sys_host.info.free_space < MINIMUM_FREE_SPACE_THRESHOLD:
|
||||
_LOGGER.warning(
|
||||
"Not enough free space, pausing add-on updates - available space %f",
|
||||
|
@ -151,11 +152,7 @@ class Tasks(CoreSysAttributes):
|
|||
if not self.sys_supervisor.need_update:
|
||||
return
|
||||
|
||||
# don't perform an update on dev channel
|
||||
if self.sys_dev:
|
||||
_LOGGER.warning("Ignore Supervisor updates on dev channel!")
|
||||
return
|
||||
|
||||
# Check free space
|
||||
if self.sys_host.info.free_space < MINIMUM_FREE_SPACE_THRESHOLD:
|
||||
_LOGGER.warning(
|
||||
"Not enough free space, pausing supervisor update - available space %s",
|
||||
|
|
|
@ -10,6 +10,7 @@ import shutil
|
|||
from typing import Awaitable, Optional
|
||||
|
||||
import jinja2
|
||||
from packaging.version import parse as pkg_parse
|
||||
|
||||
from ..const import ATTR_IMAGE, ATTR_VERSION
|
||||
from ..coresys import CoreSys, CoreSysAttributes
|
||||
|
@ -81,7 +82,10 @@ class Audio(JsonConfig, CoreSysAttributes):
|
|||
@property
|
||||
def need_update(self) -> bool:
|
||||
"""Return True if an update is available."""
|
||||
return self.version != self.latest_version
|
||||
try:
|
||||
return pkg_parse(self.version) < pkg_parse(self.latest_version)
|
||||
except (TypeError, ValueError):
|
||||
return True
|
||||
|
||||
async def load(self) -> None:
|
||||
"""Load Audio setup."""
|
||||
|
|
|
@ -8,6 +8,8 @@ import logging
|
|||
import secrets
|
||||
from typing import Awaitable, Optional
|
||||
|
||||
from packaging.version import parse as pkg_parse
|
||||
|
||||
from ..const import ATTR_ACCESS_TOKEN, ATTR_IMAGE, ATTR_VERSION
|
||||
from ..coresys import CoreSys, CoreSysAttributes
|
||||
from ..docker.cli import DockerCli
|
||||
|
@ -59,7 +61,10 @@ class HaCli(CoreSysAttributes, JsonConfig):
|
|||
@property
|
||||
def need_update(self) -> bool:
|
||||
"""Return true if a cli update is available."""
|
||||
return self.version != self.latest_version
|
||||
try:
|
||||
return pkg_parse(self.version) < pkg_parse(self.latest_version)
|
||||
except (TypeError, ValueError):
|
||||
return True
|
||||
|
||||
@property
|
||||
def supervisor_token(self) -> str:
|
||||
|
|
|
@ -11,6 +11,7 @@ from typing import Awaitable, List, Optional
|
|||
|
||||
import attr
|
||||
import jinja2
|
||||
from packaging.version import parse as pkg_parse
|
||||
import voluptuous as vol
|
||||
|
||||
from ..const import ATTR_IMAGE, ATTR_SERVERS, ATTR_VERSION, DNS_SUFFIX, LogLevel
|
||||
|
@ -107,7 +108,10 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
|||
@property
|
||||
def need_update(self) -> bool:
|
||||
"""Return True if an update is available."""
|
||||
return self.version != self.latest_version
|
||||
try:
|
||||
return pkg_parse(self.version) < pkg_parse(self.latest_version)
|
||||
except (TypeError, ValueError):
|
||||
return True
|
||||
|
||||
async def load(self) -> None:
|
||||
"""Load DNS setup."""
|
||||
|
|
|
@ -7,6 +7,8 @@ from contextlib import suppress
|
|||
import logging
|
||||
from typing import Awaitable, Optional
|
||||
|
||||
from packaging.version import parse as pkg_parse
|
||||
|
||||
from ..const import ATTR_IMAGE, ATTR_VERSION
|
||||
from ..coresys import CoreSys, CoreSysAttributes
|
||||
from ..docker.multicast import DockerMulticast
|
||||
|
@ -63,7 +65,10 @@ class Multicast(JsonConfig, CoreSysAttributes):
|
|||
@property
|
||||
def need_update(self) -> bool:
|
||||
"""Return True if an update is available."""
|
||||
return self.version != self.latest_version
|
||||
try:
|
||||
return pkg_parse(self.version) < pkg_parse(self.latest_version)
|
||||
except (TypeError, ValueError):
|
||||
return True
|
||||
|
||||
async def load(self) -> None:
|
||||
"""Load multicast setup."""
|
||||
|
|
|
@ -9,6 +9,7 @@ import secrets
|
|||
from typing import Awaitable, Optional
|
||||
|
||||
import aiohttp
|
||||
from packaging.version import parse as pkg_parse
|
||||
|
||||
from ..const import ATTR_ACCESS_TOKEN, ATTR_IMAGE, ATTR_VERSION
|
||||
from ..coresys import CoreSys, CoreSysAttributes
|
||||
|
@ -61,7 +62,10 @@ class Observer(CoreSysAttributes, JsonConfig):
|
|||
@property
|
||||
def need_update(self) -> bool:
|
||||
"""Return true if a observer update is available."""
|
||||
return self.version != self.latest_version
|
||||
try:
|
||||
return pkg_parse(self.version) < pkg_parse(self.latest_version)
|
||||
except (TypeError, ValueError):
|
||||
return True
|
||||
|
||||
@property
|
||||
def supervisor_token(self) -> str:
|
||||
|
|
|
@ -8,6 +8,7 @@ from tempfile import TemporaryDirectory
|
|||
from typing import Awaitable, Optional
|
||||
|
||||
import aiohttp
|
||||
from packaging.version import parse as pkg_parse
|
||||
|
||||
from .const import SUPERVISOR_VERSION, URL_HASSIO_APPARMOR
|
||||
from .coresys import CoreSys, CoreSysAttributes
|
||||
|
@ -50,7 +51,13 @@ class Supervisor(CoreSysAttributes):
|
|||
@property
|
||||
def need_update(self) -> bool:
|
||||
"""Return True if an update is available."""
|
||||
return self.version != self.latest_version
|
||||
if self.sys_dev:
|
||||
return False
|
||||
|
||||
try:
|
||||
return pkg_parse(self.version) < pkg_parse(self.latest_version)
|
||||
except (TypeError, ValueError):
|
||||
return True
|
||||
|
||||
@property
|
||||
def version(self) -> str:
|
||||
|
|
Loading…
Reference in New Issue