Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

git describe via Bitbucket REST API

Pak Woon June 19, 2020

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
AUG Leaders

Atlassian Community Events