[Buildbot-devel] short git hash property?

Kevin Funk kevin.funk at kdab.com
Sat Feb 7 09:13:56 UTC 2015


On Friday 06 February 2015 18:23:58 Michael Labbé wrote:
> I am using the got_revision property to create files and directories to
> deploy installers.
> 
> Long git hashes are rough and make everyone go crosseyed when they see them
> in their file browsers.
> 
> How do I get a short git hash in a property in BuildBot? Or, because this is
> literally just truncating the hash to 7 characters (28 bits), is there a
> way to process the property on the server?
> 
> I’d do it in the tools being called in my build steps, but they are many and
> range across platforms.

We just do it this way:

As one of the very first steps:

    addStep(SetPropertyFromCommand(command=["git", "describe"],
        workdir="source", property="version"))

And then just use the "version" property instead of "got_revision".

Also has the benefit of getting the name of the last tag into the string 
(useful for package names).

Greets

> 
> -Mike
> ----------------------------------------------------------------------------
> -- Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel

-- 
Kevin Funk | kevin.funk at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 7021 bytes
Desc: not available
URL: <http://buildbot.net/pipermail/devel/attachments/20150207/751a27b7/attachment.bin>


More information about the devel mailing list