[Jenkins] Passing parameters to build-artifacts.sh

Vojtech Szocs vszocs at redhat.com
Wed Jun 22 16:40:35 UTC 2016


Thanks guys for your replies!

Sandro's advice sounds quite simple and straight-forward, I think
we can use it for now:

  $ foo=`git show -s --format=%B | grep My-Param` # My-Param: 123
  $ foo=${foo##My-Param:} # 123

Some more comments inline below.

Vojtech


----- Original Message -----
> From: "Barak Korren" <bkorren at redhat.com>
> To: "Vojtech Szocs" <vszocs at redhat.com>
> Cc: "infra" <infra at ovirt.org>
> Sent: Wednesday, June 22, 2016 5:47:46 PM
> Subject: Re: [Jenkins] Passing parameters to build-artifacts.sh
> 
> This could be done, but not trival to do, and also requires you to know,
> before merging, that this is the patch you are gonna release.

Yes - when we're about to make release build, we submit a patch that
ensures correct RPM version, I just wanted to avoid having to remove
& re-add the "snapshot" part in RPM release string for each release.

> 
> A differnt but somewhat common practice is to use git tagging and 'git
> describe' to set the package version.

Right, with tags one could use `git describe --tags --long`.

> We can make build_artifacts trigger when a tag is pushed, AFAIK Lago
> already does that...

That would be nice to have :)

> בתאריך 22 ביוני 2016 18:39,‏ "Vojtech Szocs" <vszocs at redhat.com> כתב:
> 
> > Hi,
> >
> > I'm just curious whether it's possible to do the following:
> >
> > Let's say we have a project (ovirt-engine-dashboard) built by Jenkins,
> > which means there's a Jenkins job that runs build-artifacts.sh script
> > whenever a patch gets merged via gerrit.
> >
> > Can we somehow pass custom parameters to build-artifacts.sh for such
> > (Jenkins CI) builds?
> >
> > For example, putting something like this into commit message:
> >
> >   My-Param 123
> >
> > would reflect into `My-Param` env. variable when running the script?
> >
> > Motivation: for release builds (which shouldn't contain the "snapshot"
> > part [*] in RPM release string), pass parameter to build-artifacts.sh
> > that ensures the "snapshot" part is empty. This way, we don't need to
> > patch the project prior to release (remove "snapshot" in spec) & then
> > patch it again after the release (re-add "snapshot" in spec).
> >
> > [*] {date}git{commit}
> >
> > Thanks,
> > Vojtech
> > _______________________________________________
> > Infra mailing list
> > Infra at ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/infra
> >
> 



More information about the Infra mailing list