[opensuse-buildservice] obs service github_tarballs

Hello, I need your help with this _Service cause I want to get an automatic rebuild after creating a new 'tag' in github. On my research I stumbled over 'github_tarballs' Service which seems the one to be used for this. sadly there is not much documentation on how to use it ... ... used info from here: https://openbuildservice.org/2013/11/22/source-update-via_token ... so I took the sample from 'github code' ... <services> <service name="obs_scm"> <param name="url">git://github.com/openSUSE/obs-build.git</param> <param name="scm">git</param> </service> <service mode="buildtime" name="tar" /> <service mode="buildtime" name="recompress"> <param name="file">*.tar</param> <param name="compression">xz</param> </service> <service mode="buildtime" name="set_version" /> <service name="github_tarballs"> <summary>Download tarballs and update package data</summary> <description>This service downloads tarballs and updates the spec file version and changes file</description> <param name="url"> <description>https://github.x.y.z/user/mpremoval/archive/1.0.tar.gz</description> <required/> </param> <param name="package"> <description>mpremoval</description> </param> <param name="filename"> <description>mpremoval</description> </param> <param name="email"> <description>user@internal.mail</description> <required/> </param> <param name="repo_owner"> <description>user</description> <required/> </param> <param name="repo_name"> <description>mpremoval</description> <required/> </param> <param name="target"> <description>tokencode(removed)</description> <required/> </param> </service> </services> ...but then I am running into the following Error when trying to do a local build ... Server returned an error: HTTP Error 400: Bad Request remote error: unknown element summary seems that the 'service' section for 'github_tarballs' is not correct. Or I am doing something completely wrong. So any help on how to get this work would be really appreciated. Thank you for your help ... Kind Regards Chris P.S.: the package 'obs-service-github_tarballs' is installed is installed on the OBS instance. both, github and obs are own instances ....

Am Dienstag, den 26.06.2018, 09:37 +0200 schrieb Christian:
Hello,
I need your help with this _Service cause I want to get an automatic rebuild after creating a new 'tag' in github.
only after a new tag - or on each commit ? -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org

Am 26.06.2018 um 09:56 schrieb Frank Schreiner:
only after a new tag - or on each commit ? only after a new tag ... I did set on github side (Services: OBS and Refs: refs/tags/*)
hope this is correct so far ... -- Christian ------------------------------------------------------------ https://join.worldcommunitygrid.org?recruiterId=177038 ------------------------------------------------------------ http://www.sc24.de - Sportbekleidung ------------------------------------------------------------

Am Dienstag, den 26.06.2018, 10:01 +0200 schrieb Christian:
Am 26.06.2018 um 09:56 schrieb Frank Schreiner:
only after a new tag - or on each commit ?
only after a new tag ... I did set on github side (Services: OBS and Refs: refs/tags/*)
hope this is correct so far ...
Is there a valid reason, why you try to use github_tarballs instead of obs_scm/tar_scm? -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org

Am 26.06.2018 um 10:18 schrieb Frank Schreiner:
Is there a valid reason, why you try to use github_tarballs instead of obs_scm/tar_scm? I am not really aware about the possibilities of the _service, what they do and where the differences are ...
if you have a great idea on how to get this work best I am willing to hear any solution that enables me to solve that problem ... ... triger rebuild on obs with new version on each new tag on github. Thank you :) -- Christian ------------------------------------------------------------ https://join.worldcommunitygrid.org?recruiterId=177038 ------------------------------------------------------------ http://www.sc24.de - Sportbekleidung ------------------------------------------------------------

I am not really aware about the possibilities of the _service, what they do and where the differences are ...
ok, obs_scm/tar_scm gives you the possibility to create a new tar/obscpio archive to use in your builds. If you want to create on each new tag - I don`t have the correct/tested solution. But I can tell you how we use it. We use it in OBS:Server:Unstable and OBS:Server:2.9 for example. https://build.opensuse.org/package/view_file/OBS:Server:Unstable/obs-server/... https://build.opensuse.org/package/view_file/OBS:Server:2.9:Staging/obs-serv... You can use github services (like "Obs") to trigger a new service run in your staging project. As you have the possibility to define "Refs" in your github service, I hope this also works for tags. Otherwise you could create a staging project for continuous integration and a "final project" with a "disabled" service to release your software. cu M0ses -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org

Am 26.06.2018 um 10:59 schrieb Frank Schreiner:
I am not really aware about the possibilities of the _service, what they do and where the differences are ...
ok, obs_scm/tar_scm gives you the possibility to create a new tar/obscpio archive to use in your builds.
still wondering why downloading sources and repackaging when github provides a tar.gz archive for download after creating a tag. only githubs naming scheme is somehow strange. The tag '1.0' results in downlink...'1.0.tar.gz' instead of expected 'pkgname'-1.0.tar.gz
If you want to create on each new tag - I don`t have the correct/tested solution.
But I can tell you how we use it.
We use it in OBS:Server:Unstable and OBS:Server:2.9 for example.
https://build.opensuse.org/package/view_file/OBS:Server:Unstable/obs-server/...
https://build.opensuse.org/package/view_file/OBS:Server:2.9:Staging/obs-serv...
You can use github services (like "Obs") to trigger a new service run in your staging project.
I configured this already with Refs: refs/tags/*
As you have the possibility to define "Refs" in your github service, I hope this also works for tags.
still trying to find out if that works and still trying to find out how to use this with github_tarballs ...
Otherwise you could create a staging project for continuous integration and a "final project" with a "disabled" service to release your software.
I am having a 'subproject' (PRJ:testing) where I want to establish this, if this release/tag is OK then it will be submitted to 'PRJ' ....
cu M0ses
Thank you for your help -- Christian ------------------------------------------------------------ https://join.worldcommunitygrid.org?recruiterId=177038 ------------------------------------------------------------ http://www.sc24.de - Sportbekleidung ------------------------------------------------------------

On Jun 26 2018, Christian <chris@computersalat.de> wrote:
<service name="github_tarballs">
<summary>Download tarballs and update package data</summary>
<description>This service downloads tarballs and updates the spec file version and changes file</description>
<param name="url">
<description>https://github.x.y.z/user/mpremoval/archive/1.0.tar.gz</description>
<required/>
</param>
<param name="package">
<description>mpremoval</description>
</param>
<param name="filename">
<description>mpremoval</description>
</param>
<param name="email">
<description>user@internal.mail</description>
<required/>
</param>
<param name="repo_owner">
<description>user</description>
<required/>
</param>
<param name="repo_name">
<description>mpremoval</description>
<required/>
</param>
<param name="target">
<description>tokencode(removed)</description>
<required/>
</param>
</service>
This is the service _description_, which needs to be put into /usr/lib/obs/service/github_tarballs.service, together with a script that implements it. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org

Am 26.06.2018 um 10:16 schrieb Andreas Schwab:
This is the service _description_, which needs to be put into /usr/lib/obs/service/github_tarballs.service, together with a script that implements it. You are confusing me ... so if this is the file that needs to be modified on the obs instance, why is there parts for a 'specific package' (name=package) ... and URL of an specific tarball ...
what needs to be added to the 'package' _service file ? I would really love to have an real example ... I am still lost ... :( -- Christian ------------------------------------------------------------ https://join.worldcommunitygrid.org?recruiterId=177038 ------------------------------------------------------------ http://www.sc24.de - Sportbekleidung ------------------------------------------------------------

On Jun 26 2018, Christian <chris@computersalat.de> wrote:
Am 26.06.2018 um 10:16 schrieb Andreas Schwab:
This is the service _description_, which needs to be put into /usr/lib/obs/service/github_tarballs.service, together with a script that implements it. You are confusing me ... so if this is the file that needs to be modified on the obs instance, why is there parts for a 'specific package' (name=package) ... and URL of an specific tarball ...
It's just a (rudimentary) documentation. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org

You are confusing me ... so if this is the file that needs to be modified on the obs instance, why is there parts for a 'specific package' (name=package) ... and URL of an specific tarball ...
It's just a (rudimentary) documentation.
No, the .service file is just a description of the service in XML which _could_ include some documentation -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org

Am 26.06.2018 um 11:08 schrieb Frank Schreiner:
You are confusing me ... so if this is the file that needs to be modified on the obs instance, why is there parts for a 'specific package' (name=package) ... and URL of an specific tarball ...
It's just a (rudimentary) documentation.
No, the .service file is just a description of the service in XML which _could_ include some documentation
I think the README and '.service' file _should_ include some 'vital' documentation and an example (especially in the README) ... I would love to see this updated ... -- Christian ------------------------------------------------------------ https://join.worldcommunitygrid.org?recruiterId=177038 ------------------------------------------------------------ http://www.sc24.de - Sportbekleidung ------------------------------------------------------------

On Tue, 26 Jun 2018 09:37:50 +0200 Christian <chris@computersalat.de> wrote:
Hello,
I need your help with this _Service cause I want to get an automatic rebuild after creating a new 'tag' in github.
On my research I stumbled over 'github_tarballs' Service which seems the one to be used for this.
sadly there is not much documentation on how to use it ...
... used info from here:
https://openbuildservice.org/2013/11/22/source-update-via_token
... so I took the sample from 'github code' ...
<services>
<service name="obs_scm">
<param name="url">git://github.com/openSUSE/obs-build.git</param>
<param name="scm">git</param>
</service>
<service mode="buildtime" name="tar" />
<service mode="buildtime" name="recompress">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service mode="buildtime" name="set_version" />
<service name="github_tarballs">
<summary>Download tarballs and update package data</summary>
<description>This service downloads tarballs and updates the spec file version and changes file</description>
<param name="url">
<description>https://github.x.y.z/user/mpremoval/archive/1.0.tar.gz</description>
<required/>
</param>
<param name="package">
<description>mpremoval</description>
</param>
<param name="filename">
<description>mpremoval</description>
</param>
<param name="email">
<description>user@internal.mail</description>
<required/>
</param>
<param name="repo_owner">
<description>user</description>
<required/>
</param>
<param name="repo_name">
<description>mpremoval</description>
<required/>
</param>
<param name="target">
<description>tokencode(removed)</description>
<required/>
</param>
</service>
</services>
...but then I am running into the following Error when trying to do a local build ...
Server returned an error: HTTP Error 400: Bad Request
remote error: unknown element summary
seems that the 'service' section for 'github_tarballs' is not correct.
Or I am doing something completely wrong.
So any help on how to get this work would be really appreciated.
Thank you for your help ...
Kind Regards
Chris
P.S.: the package 'obs-service-github_tarballs' is installed is installed on the OBS instance.
both, github and obs are own instances ....
Hi Christian an example of _service, where I'm downloading something from github, recompress it and do set the version would be: <services> <service name="tar_scm" mode="disabled"> <param name="url">https://github.com/foo/bar.git</param> <param name="scm">git</param> <param name="exclude">.git</param> <param name="versionformat">1-git.%h</param> <param name="revision">remotes/origin/master</param> </service> <service name="recompress" mode="disabled"> <param name="file">*.tar</param> <param name="compression">gz</param> </service> <service name="set_version" mode="disabled"> <param name="basename">bar</param> </service> </services> I recommend you to read the documentation provided on https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.source_serv... regards, -- Victor Pereira SUSE LINUX GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 21284 (AG Nürnberg) Maxfeldstraße 5 90409 Nürnberg

Am 26.06.2018 um 11:18 schrieb Victor Pereira:
Hi Christian an example of _service, where I'm downloading something from github, recompress it and do set the version would be:
<services> <service name="tar_scm" mode="disabled"> <param name="url">https://github.com/foo/bar.git</param> <param name="scm">git</param> <param name="exclude">.git</param> <param name="versionformat">1-git.%h</param> <param name="revision">remotes/origin/master</param> </service> <service name="recompress" mode="disabled"> <param name="file">*.tar</param> <param name="compression">gz</param> </service> <service name="set_version" mode="disabled"> <param name="basename">bar</param> </service> </services>
I recommend you to read the documentation provided on https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.source_serv... Hi Victor,
thanks for the example. You are using '%h' in 'versionformat' ... where do I get information about the 'placeholders/vars' ? But all 3 services are 'disabled' ... why ? Thank you :) -- Christian ------------------------------------------------------------ https://join.worldcommunitygrid.org?recruiterId=177038 ------------------------------------------------------------ http://www.sc24.de - Sportbekleidung ------------------------------------------------------------

Am Tue, 26 Jun 2018 09:37:50 +0200 schrieb Christian <chris@computersalat.de>:
rebuild after creating a new 'tag' in github.
github might be able to do a 'osc service rr $prj $pkg', but it seems that OBS lacks a concept of 'latest reachable tag from $branch' for the "revision" parameter. At least it is not clear from /usr/lib/obs/service/tar_scm.service how that should be done. For the time being create the _service on the fly. If "latest_git_tag" changes a new _service will be commited. <services> <service name="obs_scm"> <param name="filename">${pkg}</param> <param name="revision">${latest_git_tag}</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://gitlab.com/${prj}/${pkg}.git</param> <param name='versionformat'>%ci.%h</param> </service> <service mode="buildtime" name="tar"> <param name="obsinfo">${pkg}.obsinfo</param> </service> <service mode="buildtime" name="set_version"> <param name="basename">${pkg}</param> </service> </services> Olaf

Am 26.06.2018 um 13:01 schrieb Olaf Hering:
Am Tue, 26 Jun 2018 09:37:50 +0200 schrieb Christian <chris@computersalat.de>:
rebuild after creating a new 'tag' in github.
github might be able to do a 'osc service rr $prj $pkg', but it seems that OBS lacks a concept of 'latest reachable tag from $branch' for the "revision" parameter. At least it is not clear from /usr/lib/obs/service/tar_scm.service how that should be done. AFAIUnderstand is tar_scm useful for 'commit' based rebuilds ... yeah that is nice, but not wanted here.
That is why I thought github_tarballs service could be a solution, but still not aware how to get 'refs/tags/latest' ...
For the time being create the _service on the fly. If "latest_git_tag" changes a new _service will be commited.
... how to get 'latest_git_tag' ...
<services> <service name="obs_scm"> <param name="filename">${pkg}</param> <param name="revision">${latest_git_tag}</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://gitlab.com/${prj}/${pkg}.git</param> <param name='versionformat'>%ci.%h</param> </service> <service mode="buildtime" name="tar"> <param name="obsinfo">${pkg}.obsinfo</param> </service> <service mode="buildtime" name="set_version"> <param name="basename">${pkg}</param> </service> </services>
Olaf
this looks nice, but looks like this must be done somehow manual each time you create a tag on github you go to obs and update the package manually ... or did I get something wrong ... I still have no idea what obs is able to do ... probably cause of very less documentation :-( -- Christian ------------------------------------------------------------ https://join.worldcommunitygrid.org?recruiterId=177038 ------------------------------------------------------------ http://www.sc24.de - Sportbekleidung ------------------------------------------------------------

On Tue, 26 Jun 2018 14:48:25 +0200 Christian <chris@computersalat.de> wrote:
Am 26.06.2018 um 13:01 schrieb Olaf Hering:
Am Tue, 26 Jun 2018 09:37:50 +0200 schrieb Christian <chris@computersalat.de>:
rebuild after creating a new 'tag' in github.
github might be able to do a 'osc service rr $prj $pkg', but it seems that OBS lacks a concept of 'latest reachable tag from $branch' for the "revision" parameter. At least it is not clear from /usr/lib/obs/service/tar_scm.service how that should be done. AFAIUnderstand is tar_scm useful for 'commit' based rebuilds ... yeah that is nice, but not wanted here.
That is why I thought github_tarballs service could be a solution, but still not aware how to get 'refs/tags/latest' ...
For the time being create the _service on the fly. If "latest_git_tag" changes a new _service will be commited.
... how to get 'latest_git_tag' ...
<services> <service name="obs_scm"> <param name="filename">${pkg}</param> <param name="revision">${latest_git_tag}</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://gitlab.com/${prj}/${pkg}.git</param> <param name='versionformat'>%ci.%h</param> </service> <service mode="buildtime" name="tar"> <param name="obsinfo">${pkg}.obsinfo</param> </service> <service mode="buildtime" name="set_version"> <param name="basename">${pkg}</param> </service> </services>
Olaf
this looks nice, but looks like this must be done somehow manual each time you create a tag on github you go to obs and update the package manually ... or did I get something wrong ...
I still have no idea what obs is able to do ... probably cause of very less documentation :-(
Reading the source code (https://github.com/openSUSE/obs-service-github_tarballs/blob/master/github_t...) , I think it's not supported right now, but it could be extended to do it using github API as described here: https://developer.github.com/v3/repos/releases/#get-the-latest-release -- Victor Pereira SUSE LINUX GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 21284 (AG Nürnberg) Maxfeldstraße 5 90409 Nürnberg

Am 26.06.2018 um 15:13 schrieb Victor Pereira:
Reading the source code (https://github.com/openSUSE/obs-service-github_tarballs/blob/master/github_t...) , I think it's not supported right now, but it could be extended to do it using github API as described here: https://developer.github.com/v3/repos/releases/#get-the-latest-release
Thank you for the info ... -- Christian ------------------------------------------------------------ https://join.worldcommunitygrid.org?recruiterId=177038 ------------------------------------------------------------ http://www.sc24.de - Sportbekleidung ------------------------------------------------------------
participants (5)
-
Andreas Schwab
-
Christian
-
Frank Schreiner
-
Olaf Hering
-
Victor Pereira