Search code examples
gitbuildbot

Buildbot Git of a tag or SHA


Is there a way to set the buildbot Git step to checkout a specific SHA number? The documentation says that a TAG can be specified, but I can't find any mention of specific SHA number (not that a format for TAG is any clearer. Just setting TAG name instead of a branch fails).


Solution

  • There a workaround, not a direct solution. In the factory, after the Git step to pull the master of the Git repository in question, add a ShellCommand step to basically change to the needed SHA/Tag:

    fac.addStep(ShellCommand(name="GIT at SHA",
                            command=["git", "checkout", "76dd56c61ffa96b2cfe6b18e2fa7c054d8804508"], 
                            workdir="<GIT root>",
                            timeout=None))