Class Build

java.lang.Object
hudson.plugins.git.util.Build
All Implemented Interfaces:
Serializable, Cloneable

@ExportedBean(defaultVisibility=999) public class Build extends Object implements Serializable, Cloneable
Remembers which build built which Revision.
See Also:
  • Field Details

    • marked

      public hudson.plugins.git.Revision marked
      Revision in the repository marked as built.

      This field is used to avoid doing the same build twice, by (normally) recording the commit in the upstream repository that initiated the build.

      For simple use cases, this value is normally the same as revision. Where this gets different is when a revision to checkout is decorated and differs from the commit found in the repository (for example, a merge before a build.) In such a situation, we need to remember the commit that came from the upstream so that future polling and build will not attempt to do another build from the same upstream commit.

      In some other kind of speculative merging, such as github pull request build, this field should point to the same value as revision, as we want to be able to build two pull requests rooted at the same commit in the base repository.

    • revision

      public hudson.plugins.git.Revision revision
      Revision that was actually built.

      This points to the commit that was checked out to the workspace when GitSCM.checkout(hudson.model.Run<?, ?>, hudson.Launcher, hudson.FilePath, hudson.model.TaskListener, java.io.File, hudson.scm.SCMRevisionState) left.

    • hudsonBuildNumber

      public int hudsonBuildNumber
    • hudsonBuildResult

      public Result hudsonBuildResult
  • Constructor Details

    • Build

      public Build(hudson.plugins.git.Revision marked, hudson.plugins.git.Revision revision, int buildNumber, Result result)
    • Build

      public Build(hudson.plugins.git.Revision revision, int buildNumber, Result result)
  • Method Details

    • getSHA1

      public org.eclipse.jgit.lib.ObjectId getSHA1()
    • getRevision

      @Exported public hudson.plugins.git.Revision getRevision()
    • getMarked

      @Exported public hudson.plugins.git.Revision getMarked()
    • getBuildNumber

      @Exported public int getBuildNumber()
    • getBuildResult

      @Exported public Result getBuildResult()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public Build clone()
      Overrides:
      clone in class Object
    • isFor

      public boolean isFor(String sha1)
    • readResolve

      public Object readResolve() throws IOException
      Throws:
      IOException