Re: Automate updating of SRCREV


Martin Jansa
 

On Fri, May 14, 2021 at 07:58:02AM -0700, Oliver Westermann wrote:
Hey,

maybe somebody already has something for this before I reinvent the wheel ;-) We've several internal tools that mostly have their own CI and are referenced in our yocto layers to be picked up by the nightly build. Usually we manually update the SRCREV and add a `git log --oneline --no-decorate <old_rev>...<new_rev>` into the update commit. That way you can easily scroll over your eg kernel repo to figure out which commit went in when. But by now we have more and more internal tools, all require regular updates so we would like to add a little CI task to update our SRCREVs.

Is there an easy way to tell bitbake / devtool to change a variable like SRCREV? I played around with various combinations of devtool modify, update-recipe and edit-recipe, but I could not get it to work as I expect.

My current goal for my script would be to use a flow roughly following this:

* Get the repo URL & branch from SRC_URI (eg by a bitbake -e <recipe> and some grep magic)
* Do a shallow clone in a temp dir
* Get new HEAD commit for branch, compare with current
* create git log for commit message
* update REV in recipe
* commit

Looking forward to suggestions, Olli
If you really want to update SRCREVs often for CI jobs, then I would
setup separate job with some .inc file which sets SRCREVs of all the
components you want to test to AUTOREV and let it run as often you can
afford (even triggered from every push if your builds are quick or you
have many builders available).

Then whenever you want to "release" you can either dump the last built
revisions from this AUTOREV-build (either directly from
cache/bb_persist_data.sqlite3 or from e.g. buildhistory and dump them in
some release-1.2.3.inc included by your DISTRO (or update SRCREVs in the
individual recipes).

Regards,

Join yocto@lists.yoctoproject.org to automatically receive all group messages.