Skip to content

How can I get the commit id? #7376

Answered by EDMPhoenix
cathaysia asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can use ShellCommand in Buildbot to run git commands and capture their output. This is done by creating a step in your build process that uses ShellCommand.

Here's an example of how to get all commit IDs:

from buildbot.plugins import *

factory = util.BuildFactory()
factory.addStep(steps.ShellCommand(command=["git", "log", "--pretty=format:'%H'"],
                                   workdir="build/src",
                                   logEnviron=False,
                                   decodeRC={0:SUCCESS, 1:FAILURE, 2:FAILURE, 3:FAILURE, 4:FAILURE, 5:FAILURE},
                                   name="Get Commit IDs",
                                   description="Getting all…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@cathaysia
Comment options

@EDMPhoenix
Comment options

@cathaysia
Comment options

@EDMPhoenix
Comment options

@cathaysia
Comment options

Answer selected by cathaysia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants