Package: hassio-repo-updater
Community Home Assistant Add-ons Repository UpdaterAboutReads remote add-on repositories, determines versions and generates
changelogs to update the add-on repository fully automated.Mainly used by the Community Home Assistant Add-ons project.Please note, this program cannot be used with the general documented
Home Assistant add-on repository approach and only works in the setup where
each add-on has its own GitHub repository.InstallationUsing pip, the Python package manager:pipinstallhassio-repo-updaterUsageThe Repository Updater is a pretty simple, straightforward CLI tool.Usage: repository-updater [OPTIONS]

  Community Home Assistant Add-ons Repository Updater.

Options:
  --token <TOKEN>                 GitHub access token
  --repository <orgname/reponame>
                                  The Home Assistant Addons repository to update
  --addon <TARGET>                Update a single/specific add-on
  --force                         Force an update of the add-on repository
  --dryrun, --dry-run, --simulate
                                  Do everything which is supposed to be done,
                                  but don't write any changes. This is used to
                                  see what would happen with the specified
                                  action, without actually modifying anything.
  --version                       Show the version and exit.
  --help                          Show this message and exit.To get a GitHub token, please see the GitHub article:Create a tokenAdd-ons Repository ConfigurationIn order for the Repository Updater to do its job, we need feed it some
information. It needs to know which add-ons there are currently in the
add-ons repository and where each add-on is located on GitHub.Secondly, it needs to know the stability channel of the add-ons repository.
There are 3 stability channel levels available:stable: Stable releasesbeta: Beta / test releasesedge: Latest builds, usually build straight from developmentCreate a.addons.ymlfile in the root of the add-ons repository,
which looks like this:channel:edgeaddons:example:repository:hassio-addons/addon-exampletarget:exampleimage:hassioaddons/example-{arch}homebridge:repository:hassio-addons/addon-homebridgetarget:homebridgeimage:hassioaddons/homebridge-{arch}pihole:repository:hassio-addons/addon-pi-holetarget:pi-holeimage:hassioaddons/pi-hole-{arch}channels:beta, stableThe target in the add-ons repository is specified as the key for each add-on,
this will be the directory name inside the add-ons repository as well. This is
different from thetargetkey, in a way that that key specified the add-on
target directory inside the git repository of the add-on itself.In the above example,piholewill be the name of the add-on directory
inside the add-ons repository, whilepi-holeis the directory in the add-on
git repo that contains the actual add-on.repositoryspecified the location of the add-on on GitHub. This must be
inorganization/repositoryorusername/repositoryformat.Theimagekey defines the Docker container images on Docker Hub
for this add-on.{arch}can be used as a placeholder for the architecture and
is automatically replaced internally by the Repository Updater.Finally, you can add individualchannelskey for each add-on. This allows you
to store several versions of add-ons in one repository at once. This way is
convenient if you have your own repository with a small number of add-ons.Add-ons Repository README templateIt is nice to have an up to dateREADME.mdfile in your add-ons repository,
but maintaining one, can be quite time-consuming. The Repository updater is
able to update theREADME.mdfile for you each run.This is done using a Jinja2 template. Simply create a file called.README.j2in the root of your add-ons repository. Most information is collected
from the add-onconfig.jsonand GitHub repo.The following variables are available in your templates and are passed into it
upon rendering your template.addons: A list of add-ons in this add-ons repositorychannel: The channel type of this add-ons repositorydescription: The GitHub add-ons repository descriptionhomepage: The GitHub add-ons repository specified homepage URLissues: The URL to the issues listing of the GitHub add-ons repositoryname: The full GitHub name, e.g.,hassio-addons/repositoryrepo: The full URL to the GitHub add-ons repositoryIn the above variables, a list ofaddonswas specified. Each item in this
list contains the following variables:name: Name of the add-ondescription: Description of the add-onurl: URL of the add-onrepo: URL to the add-on GitHub repoarchs: List of supported architectures by this add-onslug: The add-on slugtarget: The target directory of the add-on inside the add-ons repositoryimage: The (untouched) Docker Hub container image nameimages: Dictionary of images per architectureaarch64:aarch64DockerHub image (if arch is supported)amd64:amd64DockerHub image (if arch is supported)armhf:armhfDockerHub image (if arch is supported)armv7:armv7DockerHub image (if arch is supported)i386:i386DockerHub image (if arch is supported)version: The version of the add-oncommit: Full SHA of the commit bound to the current versiondate: Date and time of the above commit/versionExamplesIt is quite a complex setup to create an example for in this little document.
Nevertheless, see the [Community Home Assistant Addons Repository][repository]
for an example of.README.j2and.addons.ymlfiles.The community project also uses GitLab for building its add-ons. Each
add-on runs this tool upon build, ensuring the repositories are always up to
date. Be sure to check some of the add-ons out as well to learn more about
the whole setup.Why do this allLet me start by saying, there is nothing wrong with the documented way of
setting up a Home Assistant add-ons repository. If you are just starting out
developing add-ons, please use the official documented way. You can always
decide to change your workflow.Nevertheless, there are some advantages using the alternative method:Each add-on has its own Git repository, which allows for a maximum separation
of concerns. Each add-on has its own issue list, releases, and all other
GitHub goodness.Release and versioning is based on GitHub Releases / Git tagging. Which
does not need updating of configuration files and is done with a single click.Each add-on Git repository is downloadable and instantly buildable locally.Every single piece of manual labor around maintaining an add-ons repository
is fully automated. Building, testing, quality control, publishing, changelogs
and even the add-ons repository README are updated automatically.  This level
of automation allows us to focus completely on developing the actual add-on.Availability of Beta and Edge channels for everyone who's interested or
willing to test.Known issues and limitationsAny kind of testing... is missing...Changelog & ReleasesThis repository keeps a change log usingGitHub's releasesfunctionality. The format of the log is based onKeep a Changelog.Releases are based onSemantic Versioning, and use the format
ofMAJOR.MINOR.PATCH. In a nutshell, the version will be incremented
based on the following:MAJOR: Incompatible or major changes.MINOR: Backwards-compatible new features and enhancements.PATCH: Backwards-compatible bugfixes and package updates.SupportGot questions?You have several options to get them answered:The Home AssistantCommunity Forum.You could alsoopen an issue hereGitHub.ContributingThis is an active open-source project. We are always open to people who want to
use the code or contribute to it.We have set up a separate document containing ourcontribution guidelines.Thank you for being involved! :heart_eyes:Authors & contributorsThe original setup of this repository is byFranck Nijhofwith major
modifications byAndrey "Limych" Khrolenok.For a full list of all authors and contributors,
checkthe contributor's page.LicenseMIT LicenseCopyright (c) 2018-2020 Franck NijhofCopyright (c) 2020 Andrey "Limych" KhrolenokPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.