I come from Jenkins, and there, it is possible to obtain the Git commit hash associated with the last successful build on a Git branch. The environment variable GIT_PREVIOUS_SUCCESSFUL_COMMIT
is provided by the Jenkins Git plugin. For each build, its value is set to the commit hash of the previous successfully built commit on the branch. The commit hash can then be used to compute the list of changed files. That's how I am able to get the list of changed files in Jenkins.
With Buildbot, how can I:
- Get the Git commit hash of the last successful build for a branch, or alternatively,
- Get the list of changed files since the last successful build for a Git branch?
I know how to get the list of changed files since the last build for a branch, but I just don't know how to get the list of changed files since the last successful build.
Use cases
The list of changed files since the last successful build will be used in a build script. The build script (invoked as a Buildbot BuildFactory step) uses the list of changed files to determine how the project should be built.
The commit hash of last successful build is useful for rolling back source code to the last successful build's revision when newly submitted code does not work.