Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,366,248
Community Members
 
Community Events
168
Community Groups

git describe via Bitbucket REST API

Hello Community,

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.

embedded-1.4-148-g89791a0

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.

 

 

0 comments

Comment

Log in or Sign up to comment
TAGS

Atlassian Community Events