-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Initial work #2
Comments
Fantastic, you've been busy! Are the changes in the PR ready for an initial test? Am I right in thinking ./gradlew download-openhab2-online-snapshot && ./gradlew distro-openhab2-online-snapshot is the correct order to get a .deb file?
From a user's point of view, what will be different to how installation usually works which requires the documentation to change? |
I've just updated the README:
The snapshot installation will probably change because I'll try to publish the snapshots using the bintray apt-repo. |
@BClark09 I've merged the initial checkin. It would be great if you could do some testing. |
Sure thing! I've got a spare Debian laptop ready for testing, but will get round to doing it as soon as I can. |
Hey @theoweiss these points are of concern to me:
Will identical snapshots be available on both bintray and cloudbee? If so, how long? If I understand you correctly, the idea is to provide the latest snapshot on both to ease the transition for users? What I take from that: I'll have to switch the repository link to bintray in both the linux article and the openHABian scripts!? |
Testing went well:
I'm going to build #625 tomorrow so that I can test the above with specifically different snapshot files but I don't expect any differences in behaviour so from what I can see so far: Fresh installation works. |
@BClark09 you(!) have been busy, thanks a lot. Sounds very good. |
I hope to get the bintray deployment ready before the b5 release. If I get this working the snapshots will be available for a short time on both, bintray and cloudbees to ease the transition. Together with the b5 release we will remove the snapshot build from the openhab-distro project. Hopefully. I've read the available docs how to release from gradle to bintray but found no docs or examples how to handle debian repos. As you can see there is some uncertainty if all these things are in place until the b5 release. |
First major problem I'm coming up with. It doesn't look like there's any handling of configuration files even though I see they're set in gradle. For example my changes to /etc/openhab2/html/index.html are lost on an upgrade when using dpkg. |
It looks like this issue is related to: nebula-plugins/gradle-ospackage-plugin#56 EDIT 1: Adding the line " EDIT 2: Adding " EDIT 3: Seems good, submitted PR #3 |
Alright! So Debian looks good to go,
The build doesn't create a /var/run/openhab.pid so I'm guessing this is Ubuntu specific, I'll install Ubuntu on a VM and get back to you on this. openhab/openhab-distro#327 is also relevant. |
I believe the pid file problem is related to the systemd service file openhab2.service. |
Oh right, fair enough thanks. Then it'll be a mixture of that assigning start.sh as it's main program and init.d/openhab2 using start-stop-daemon and --exec |
Whilst looking into the above, I notice that /etc/init.d/openhab2 isn't included in the gradle build. I've got a branch I'm working on to address these two issues. |
@theoweiss I've tested this on multiple Linux distributions now (init.d systems need PR #6 included) across multiple updated and I'm pretty confident in the Initial work. What are the next steps here? A release task for bintray? |
@BClark09 I've just merged your PR, thanks again. Yes we will need two release tasks for bintray: one for the snapshots and one for the releases. As soon as the linux-pgk build is integrated into the cloudbees build the snapshot build must be triggered automatically each time when the openhab-distro build finished successfully. I think we should try to use the bintray gradle plugin (https://github.com/bintray/gradle-bintray-plugin). Unfortunately I found no examples for publishing deb files. Here you will find the script that I've used for publishing openHAB2 beta releases: https://github.com/openhab/openhab-linuxpkg/blob/master/resources/bin/bintray-upload-debs.sh . This must be transcribed to gradle-bintray and for snapshot releases. Furthermore I've started to port the apt-repo maven plugin to gradle (https://github.com/theoweiss/apt-repo). Until now we used it for publishing the snapshot debs. You will find my work here https://github.com/theoweiss/apt-repo-lib/tree/initialDev and here https://github.com/theoweiss/apt-repo-gradle. The idea is to have this available in case we can't get the gradle-bintray plugin running. If you don't mind it would be great if you could care for the gradle-bintray task and I'll try to finish the apt-repo gradle plugin as a fallback solution? |
Not sure when I'll be able to look at it, but I did previously have a look and think that this will get us pretty close:
Although I'm a little unsure how it will actually handle the different deb files. It'll probably need a version parameter with a variable name parameter that can be set to [online|offline]-[snapshot|beta] but not sure how best to do that yet. |
Hi @theoweiss, I've edited the above, but am very unsure on if this would generate anything useful. Would you mind testing this? (Probably best into the test name instead of openhab2). .gradlew bintrayUpload Initial thoughts:
EDIT: Nope, got a trial account and can't get this working at all. Any iteration of it and I'm stuck with the error:
As far as I know, the attributes should be set according to https://bintray.com/docs/api/ |
I had a quick look into the sources of gradle-bintray-plugin. As far as I understand the attributes will be used to create the request body: https://github.com/bintray/gradle-bintray-plugin/blob/58a2c1813ebadc8ad3242a6ca73a4fa1471823c5/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy#L231 . But the documentation indicates that debian information must be specified using HTTP matrix parameters or HTTP request headers (https://bintray.com/docs/api/#_debian_upload). May be using the gradle-bintray-plugin is a dead end approach :-( |
May be there are two other options:
We would also need a task to add a new version for each upload. |
I'd also seen the gradle Exec task as this seems to be the one used in most deb builds (for example). I like the idea of using the REST plugin though. I might have the chance to play with both tomorrow! |
@theoweiss , What do you think of https://bintray.com/benclark as a way of managing these packages. Check out the apt-snapshot repo where I've managed to get version uploads working, we may also need to add another task to clear old versions. I can successfully install and upgrade using apt when I add the repo to the sources list too, it now recognises when you're already on a version! My own branch now does this through gradle as part of the buildSnapshot command, or manually start an upload with upload-openhab2-online-snapshot etc. |
@BClark09 I'm preparing some feedback until tomorrow. |
@theoweiss, did you have any quick points of feedback? I have time to work on it this weekend. |
Hi @BClark09, sorry for the delay!
Regards, |
Thanks @theoweiss I've started updating it now, does https://bintray.com/benclark/apt-repo2 look a little more like what you were expecting (distribution needs to be changed from "null" to "testing")? Or would you rather everything be placed inside an openHAB2 package? |
I'm not sure about the last part (compare Firefox or other add-ons based software) but I get your argument "recommendation per packaging/installation option". I thought with the online version mostly stable this would be a good time to think about abandoning the offline version for openHAB 2.0 GA all together (or provide it as a less favorable version) but I do not want to argue about this in length here. Just wanted to point it out as this Issue / repo would be influenced by such a decision. ;) |
@kaikreuzer it seems like OJO ( https://oss.jfrog.org) isn't a valid option because https://www.jfrog.com/confluence/display/RTF/Deploying+Snapshots+to+oss.jfrog.org states |
As a fallback we could also stick with cloudbees and use the gradle port of the maven apt-repo plugin. It would be still better than the current solution because we could solve the lastSuccessfulBuild/WS problem which is also mentioned here openhab/openhab-distro#270 (comment) |
Hm, good point. I didn't think about the fact that we are not talking about Maven artifacts.
Let's go for this. After all, Debian packages do not know the notion of a "snapshot", so it should be fine to upload all of them to Bintray. |
Alright! That should be fine but I think we will need a task to remove old versions. |
Yes automatically removing old versions would be right solution, but for now I think it would be OK to remove them by hand using the web ui of bintray. |
To achieve that I'd assume it would suffice to run a script to perform the following steps:
|
These curl calls from gradle are a bit ugly especially the error handling and even more if some complex logic is needed. Having these calls in an "external" bash script is a way to go, but I would prefer to have these things in the gradle build script. I want to give this rest-gradle-plugin a try and if I don't succeed we could take the bash script approach. What do you think? |
Everything seems to work flawlessly till now. Great ;) Would it be possible to release a stable dummy package (e.g. the beta5 re-branded, needs to be "newer") so I can already test switching around between branches? |
For testing the best way to go is:
|
Thanks for the instructions Theo but I do not intent to get active in the repository development. I've already too much on my plate, not only related to openHAB. I thought this would be a no-brainer for you guys and it wouldn't harm anyone. But it's okay, I'll just wait for the stable to be released. |
I would also like to have everything running from within the gradle build. I particularly like the responseHandler. A quick example:
|
You could try:
for the body. And:
I googled for "groovy RESTClient PUT file" because noamt uses "groovyx.net.http.RESTClient". Just a wild guess. |
Yes, you're absolutely right! I've edited the above to contain a full example. Unfortunately, my trial expired so am not able to test what it does to Bintray. |
Which trial? You don't have to pay for Bintray "Community - Open Source". |
Whoops, my mistake. Created an account. I've been struggling with this for a while, this is what I have so far (including a little tidy up): https://github.com/BClark09/openhab-linuxpkg/blob/add-rest-plugin/build.gradle The request body needs to be converted to bytes to be used in requestBody (There's an issue for support of File), Since task configuration is done at the evaluation stage in gradle, I can't for the life of me work out how to use .bytes... |
IMHO using .bytes may be a bad idea because I think the whole contents of the deb file would be stored in the requestBody variable, which means in RAM. Could you point me to the issue you mentioned? |
Certainly - noamt/rest-gradle-plugin#26 |
I've come to the conclusion that this won't accept a file stream for a long time. I had a play around with the underlining HTTP and REST clients and the resulting task was:
I think i'd prefer to use the curl executable task within gradle considering the memory usage in this task and the extra faff that needs to be performed to get it to function correctly. I'd also prefer to use the existing task over a bash script, wdyt? |
Your right. I think the bug is in groovyx.net.http library and we would have to use the apache hc lib to get a proper solution. For now we should stick with the current curl way. What we still need is a task for removing outdated versions, where we don't have the body problem. We could use groovyx.net.http for this or a well crafted bash script. But on the top of the todo list is the adaption of the gradle script to release 2.0.0.RC1 see here: https://community.openhab.org/t/upcoming-releases/18503/17 |
@BClark09 I've started to work on the adaptions needed for releasing RC1. |
Right, is RC1 going in Stable or Testing? Apologies, I've not had any notification on that message chain until today so was not privy to the release dates. I was in the process of cleaning up the build.gradle (see branch here), but I can merge this after RC1 and also work on a way of cleaning up the old snapshot versions. I think we should be fine using the REST plugin here. @theoweiss Would you be able to add 'userdata/etc/branding-ssh.properties' to the list of files that we dis-include from the conffile list? This came up as a problem for some people using apt. |
I'd say Testing, just like the beta releases. |
@BClark09 I'm just making the RC1 release. I've merged the necessary changes to this project. I'll do a test installation. The distribution name is "testing". If you have time tomorrow could you also make some basic tests? |
@BClark09 now I've not been notified about your comment. We could add it to the next release or even increment deb "release" number and make another deb release for RC1. I'm sure you were not aware of this community thread (https://community.openhab.org/t/upcoming-releases/18503/17m) because you haven't been in the maintainer list at the time this thread was opened. With a next step we have to add a parameterised task for releasing 2.x.x., shouldn't be to hard to implement. |
That's fine, upgrade on a debian 8 machine is working fine. Also tested a fresh install on Ubuntu 14. The packages are doing their job fine and addons seems to be working fine also. However, @kaikreuzer, after the install of legacy, 1.x bindings show up on paper-ui, but when trying to install them they stall and on refresh they no longer show, even on a restart, this behaviour is seen even on a fresh install, can you and @theoweiss can confirm this behaviour?
Initially it read "Oops! That page doesn’t exist or is private." but I can read this on refresh. Thanks. |
I tried the "normal" install and all seems to work well:
So I assume it is either some local problem on your end or some issue with the apt package. |
@kaikreuzer You're right, it was a local problem and works as expected now. But I am still getting some minor behaviour: When the legacy switch is off in paper UI and then I add the legacy .kar file, (through apt, or normal installation) all the legacy bindings show up only once in the add-ons menu. If you try to install these, they will disappear until you actually turn on the legacy switch, and installation of these bindings works as expected. |
Ok, I can live with that ;-) |
I've opened a PR for the initial checkin #1. I want to use this issue to discussing the further development. Here is a to-do list with the next things which have to be done. For sure the list is not complete, just add further to-dos if they are necessary.
Todo list for openhab b5
Todo list for openhab 2.0.0
The text was updated successfully, but these errors were encountered: