Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
123 changes: 85 additions & 38 deletions azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

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"
stages:
- stage: "Validate"
jobs:
- template: templates/azp-job-version.yaml@azure
parameters:
ignoreDev: true

- 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"
2 changes: 1 addition & 1 deletion home-assistant-polymer
10 changes: 10 additions & 0 deletions scripts/dev_version.sh
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 7 additions & 0 deletions supervisor/addons/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ def version(self) -> Optional[str]:
"""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."""
Expand Down
11 changes: 9 additions & 2 deletions supervisor/api/addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
ATTR_STATE,
ATTR_STDIN,
ATTR_UDEV,
ATTR_UPDATE_AVAILABLE,
ATTR_URL,
ATTR_USB,
ATTR_VALID,
Expand Down Expand Up @@ -161,8 +162,12 @@ async def list(self, request: web.Request) -> Dict[str, Any]:
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,
Expand Down Expand Up @@ -209,6 +214,7 @@ async def info(self, request: web.Request) -> Dict[str, Any]:
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,
Expand Down Expand Up @@ -278,6 +284,7 @@ async def info(self, request: web.Request) -> Dict[str, Any]:
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,
}
)
Expand Down
2 changes: 2 additions & 0 deletions supervisor/api/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
ATTR_NETWORK_RX,
ATTR_NETWORK_TX,
ATTR_OUTPUT,
ATTR_UPDATE_AVAILABLE,
ATTR_VERSION,
ATTR_VERSION_LATEST,
ATTR_VOLUME,
Expand Down Expand Up @@ -71,6 +72,7 @@ async def info(self, request: web.Request) -> Dict[str, Any]:
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],
Expand Down
2 changes: 2 additions & 0 deletions supervisor/api/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
ATTR_MEMORY_USAGE,
ATTR_NETWORK_RX,
ATTR_NETWORK_TX,
ATTR_UPDATE_AVAILABLE,
ATTR_VERSION,
ATTR_VERSION_LATEST,
)
Expand All @@ -36,6 +37,7 @@ async def info(self, request: web.Request) -> Dict[str, Any]:
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
Expand Down
2 changes: 2 additions & 0 deletions supervisor/api/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
ATTR_NETWORK_RX,
ATTR_NETWORK_TX,
ATTR_SERVERS,
ATTR_UPDATE_AVAILABLE,
ATTR_VERSION,
ATTR_VERSION_LATEST,
CONTENT_TYPE_BINARY,
Expand All @@ -44,6 +45,7 @@ async def info(self, request: web.Request) -> Dict[str, Any]:
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,
Expand Down
2 changes: 2 additions & 0 deletions supervisor/api/homeassistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
ATTR_PORT,
ATTR_REFRESH_TOKEN,
ATTR_SSL,
ATTR_UPDATE_AVAILABLE,
ATTR_VERSION,
ATTR_VERSION_LATEST,
ATTR_WAIT_BOOT,
Expand Down Expand Up @@ -65,6 +66,7 @@ async def info(self, request: web.Request) -> Dict[str, Any]:
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,
Expand Down
2 changes: 2 additions & 0 deletions supervisor/api/multicast.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
ATTR_MEMORY_USAGE,
ATTR_NETWORK_RX,
ATTR_NETWORK_TX,
ATTR_UPDATE_AVAILABLE,
ATTR_VERSION,
ATTR_VERSION_LATEST,
CONTENT_TYPE_BINARY,
Expand All @@ -38,6 +39,7 @@ async def info(self, request: web.Request) -> Dict[str, Any]:
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
Expand Down
2 changes: 2 additions & 0 deletions supervisor/api/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
ATTR_MEMORY_USAGE,
ATTR_NETWORK_RX,
ATTR_NETWORK_TX,
ATTR_UPDATE_AVAILABLE,
ATTR_VERSION,
ATTR_VERSION_LATEST,
)
Expand All @@ -38,6 +39,7 @@ async def info(self, request: web.Request) -> Dict[str, Any]:
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
Expand Down
9 changes: 8 additions & 1 deletion supervisor/api/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
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
Expand All @@ -25,6 +31,7 @@ async def info(self, request: web.Request) -> Dict[str, Any]:
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,
}
Expand Down
4 changes: 2 additions & 2 deletions supervisor/api/panel/entrypoint.js
Original file line number Diff line number Diff line change
@@ -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 modified supervisor/api/panel/entrypoint.js.gz
Binary file not shown.
Loading