Set HB & HB UI versions for image and update HB & HB UI if update versions ahead of current #593
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
♻️ 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:
/homebridge/package.json
as "1.9.0". Compares if image version is ahead of "1.9.0"./homebridge/package.json
as "^1.9.0". Compares if image version is ahead of "1.9.0"./homebridge/package.json
. Image version is always ahead.Handles the following scenario:
/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.