openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
818 stars 251 forks source link

Add openHAB in Raspberry Imager #1708

Closed Larsen-Locke closed 1 year ago

Larsen-Locke commented 1 year ago

openHAB is currently not selectable as an image in the Raspberry Imager. This PR corrects this shortcoming. For this, Raspberry Imager needs a json file on the download location of the image that contains the path to the current image and checksums. The json is generated from a template in build.bash and made available via the build workflow. As soon as the json file is online, I would raise the corresponding issue at rpi-imager (analogue https://github.com/raspberrypi/rpi-imager/issues/427). The PR solves my issue: https://github.com/openhab/openhabian/issues/1703 The option will look like this in the Raspberry Imager:

image
Larsen-Locke commented 1 year ago

Yes, that's the way it should work

When I click on "latest" button on https://github.com/openhab/openhabian/releases/ it'll forward me to .../tag/v1.7.4/. However, artifact links seem to be specific to the version. When I replaced "v1.7.4" in the image artifact link by "latest", I could not download the latest image. So I fear I believe https://github.com/openhab/openhabian/releases/download/latest/rpi-imager-openhab.json will not be a static valid URL. and we would need to update the foundation for every release.

No, it works. You just have to switch latest and download. You can check that https://github.com/openhab/openhabian/releases/latest/download/openhabian-pi-raspios32-202206272122-git852c09c-crced70fd0c.img.xz works

See github doc Chapter 4. https://docs.github.com/en/repositories/releasing-projects-on-github/linking-to-releases#linking-to-the-latest-release

The link would be: https://github.com/openhab/openhabian/releases/latest/download/rpi-imager-openhab.json I made a test build action and it worked. I tested the file locally and it worked.

mstormi commented 1 year ago

The link would be: https://github.com/openhab/openhabian/releases/latest/download/rpi-imager-openhab.json I made a test build action and it worked. I tested the file locally and it worked.

Your current PR code would still result in ..../download/latest/.... , or am I mistaken?

Larsen-Locke commented 1 year ago

Your current PR code would still result in ..../download/latest/.... , or am I mistaken?

No, your're absolutely right. My bad. Think I used the wrong version for testing. Now it should be correct.

Problem was/is that I can only make a build in my fork not a release (Error: Process completed with exit code ), so I don't have access to the generated files. I did a cat during build and used that, but is there a better way?

mstormi commented 1 year ago

but is there a better way?

Dunno. Will merge and create a new release.

Larsen-Locke commented 1 year ago

The request for integration in rpi-imager is here: https://github.com/raspberrypi/rpi-imager/issues/472