We are trying to create a Yocto based CI builder for our embedded product that uses RPM package management. For official releases, we tag the repository and adjust the necessary bitbake recipes for the build and this all works fine. The released package can then be traced back to the tag in the repository from which it came. For CI builds we previously used a scheme wherein the third digit of the version number was the 'commits in front of tag' output of the ''git describe --first-parent". Eg.
In this example, our CI package name would be embedded-1.4.148.rpm. We use this scheme as it allows the testers to easily know that -148 is 'newer' than -147 otherwise they will need to look at the repository for the commit number eg. g8979a0.
Our old build system, checked out the code then ran the "git describe" command to figure out the version to give to the package. This is different in Bitbake as there is no checked out code at the start of the build.
This may be the closest alternative. It looks for the 'commit' keyword on the repository webpage but I believe this script only works for github.
The alternative solution is to use a combination of 'git ls-remote --tags' to find the commit number, then use the Bitbucket REST API for commits and search through the returned pages.
What we need is a Bitbucket REST API that can provide us with the 'git describe --first-parent' output.
Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events