You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.