openhab / openhab-distro

The binary distribution of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.3k stars 394 forks source link

[windows] Upgrade.ps1 doesn't handle upgrading milestones #1028

Closed tmrobert8 closed 4 years ago

tmrobert8 commented 4 years ago

https://community.openhab.org/t/trying-to-update-windows-openhab-2-5-0-m1-to-m2/80288/14

I'll submit a PR for this shortly..

Celaeno1 commented 4 years ago

@tmrobert8

Update.ps1 also not running anymore for:

Update (from 2.5.0-SNAPSHOT) to: 2.5.0-SNAPSHOT 2.5.1-SNAPSHOT 2.5.2-SNAPSHOT

Update.ps1 is stil running for updating to:

3.0.0-SNAPSHOT -->but this is useless, because there are no 3.0.0 Add-ons available.

They have changed the path to online-repo in version.properties since beginning of 2020.

tmrobert8 commented 4 years ago

@kaikreuzer ?

Looks like the 2.5 snapshots aren't on ci.openhab.org but are on bintray which (I believe) neither update script uses for snapshots?

kaikreuzer commented 4 years ago

The update scripts reference one build plan, which now builds 3.0.0-SNAPSHOT (https://ci.openhab.org/job/openHAB-Distribution/). We have created a separate build plan for 2.5.x-SNAPSHOTS at https://ci.openhab.org/view/Integration%20Builds%20(2.5.x)/job/openHAB2.5.x-Distribution/, but this is not known to the scripts.

I guess it makes sense to change the update scripts for the 2.5.x distro to the new url.

Celaeno1 commented 4 years ago

@tmrobert8

I've tested above Link with a changed update.ps1, changing the following lines to:

489, 490, 491:

$DownloadLocation="https://ci.openhab.org/view/Integration%20Builds%20(2.5.x)/job/openHAB2.5.x-Distribution/lastSuccessfulBuild/artifact/distributions/openhab/target/openhab-$OHVersionName.zip" $AddonsDownloadLocation="https://ci.openhab.org/view/Integration%20Builds%20(2.5.x)/job/openHAB2.5.x-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-addons/target/openhab-addons-$OHVersionName.kar" $LegacyAddonsDownloadLocation="https://ci.openhab.org/view/Integration%20Builds%20(2.5.x)/job/openHAB2.5.x-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-addons-legacy/target/openhab-addons-legacy-$OHVersionName.kar"

And it worked for updating to 2.5.2-SNAPSHOT.

tmrobert8 commented 4 years ago

@kaikreuzer While we could make a change to the update scripts to handle 2.5.x snapshots - existing installations won't be able to use it unless they do something like what @Celaeno1 did or manually update first. I'm not sure if it's worth the trouble then.

BTW - this brings back the idea that we should have a file somewhere (in github, on docs, somewhere accessible from http) that the installers and update scripts can download to find out the versions available and their download version. That way you'd have find grained control over everything and download paths don't need to be hardcoded (and a plus - the installers/updaters can offer a choice to the user rather than hope the user knows what they are doing - much nicer). Want me to put to post an issue with the thoughts I have on that?

kaikreuzer commented 4 years ago

@tmrobert8 You are absolutely right, this change does not make any sense. I hence chose a different solution: I renamed the build plans, so that the new one is now called openHAB3-Distribution and the old one now builds the 2.5.x snapshots. I successfully updated to 2.5.2-SNAPSHOT using the update script on Mac right now.

But for the future, I agree - we could move the location information to some centrally located file, so that we have a better chance to do changes to it. If you like, feel free to create an issue for that (or even a PR ;-)).

Celaeno1 commented 4 years ago

I also successfully updated to 2.5.2-SNAPSHOT using the original update.ps1 on Windows right now. Thanks a lot.

kaikreuzer commented 4 years ago

Great - so I guess we can close the issue then!