Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set HB & HB UI versions for image and update HB & HB UI if update versions ahead of current #593

Open
wants to merge 7 commits into
base: latest
Choose a base branch
from

Conversation

justjam2013
Copy link

@justjam2013 justjam2013 commented Feb 18, 2025

♻️ Current situation

On clean install, Docker image installs latest version of Homebridge and Homebridge UI.
On update install, Docker image does not install any version of Homebridge and latest version of Homebridge UI.

This behavior is not consistent and confusing. Also, there is no option to roll back to a specific image to get a known-good installation.

💡 Proposed solution

Docker image provides set versions of Homebridge and Homebridge UI. This allows to roll back to a specific image to get a known-good installation.

On clean install, Docker image installs image version of Homebridge and Homebridge UI.
On update install, Docker image installs image version of Homebridge if it is ahead of currently installed Homebridge version, and installs image version of Homebridge UI if it is ahead of currently installed Homebridge UI version.

Handles following scenarios:

  • Version is declared in /homebridge/package.json as "1.9.0". Compares if image version is ahead of "1.9.0".
  • Version is declared in /homebridge/package.json as "^1.9.0". Compares if image version is ahead of "1.9.0".
  • No version is found in /homebridge/package.json. Image version is always ahead.

Handles the following scenario:

  • Version is declared in /homebridge/package.json as "1.9.0-beta.1". Compares if image version is ahead of "1.9.0.1".

"1.9.0" is converted as "1" -> "001", "9" -> "009", "0" -> "000", "" -> "000" -> 1009000000
"1.9.0.1" is converted as "1" -> "001", "9" -> "009", "0" -> "000", "1" -> "000" -> 1009000001

So a beta version will be evaluated as ahead of the release version. While this is not true, if the user is installing beta builds, maybe they are doing some development, or doing some testing of some sort, so the install should not overwrite their custom environment. If they are playing with betas, they know enough about updating versions and should expect to manually update to the latest release. Maybe this should be described in the README.md file.

📝 Note

Prior to publishing a new Docker image, update package-config-docker.json to the Homebridge and Homebridge UI versions that this image will install.

@justjam2013
Copy link
Author

Note: Do not merge yet. Adding code changes for new install to use set versions of Homebridge and Homebridge UI.

@justjam2013
Copy link
Author

Ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant