[users at bb.net] steps.Git(): pass in a revision?

Linus Arver linusarver at gmail.com
Fri May 26 04:23:57 UTC 2017


Hello,

I have project Bar that depends on another project Foo (uses git). In
the build steps of Bar, I need to check out a particular known commit of
Foo, using a commit hash. I would like to use something like

    steps.Git(repourl=url_of_Foo, revision=desired_commit_hash)

but steps.Git() only gives branch-level granularity with the "branch="
keyword.

What is the recommended course of action? I'm thinking of just using a
ShellCommand step to invoke `git reset --hard desired_commit_hash` but I
would like to hear other people's thoughts.

Here are some thoughts I've had already:

(1) I am not sure if I want to use a multiple-codebases approach as
described in [1] because I don't want changes to Foo's repo to trigger
builds to Bar.

(2) I could just make a branch on Foo that tracks the
desired_commit_hash, and check out this branch. But, I do not yet have
automation to make such a branch update on its own, should the
desired_commit_hash change.

Best,
Linus

[1]: http://docs.buildbot.net/latest/manual/concepts.html#multiple-codebase-builds


More information about the users mailing list