Class BuildData

    • Field Detail

      • buildsByBranchName

        public Map<String,​Build> buildsByBranchName
        Map of branch name -> build (Branch name to last built SHA1).

        This map contains all the branches we've built in the past (including the build that this BuildData is attached to)

      • scmName

        public String scmName
        The name of the SCM as given by the user.
      • remoteUrls

        public Set<String> remoteUrls
        The URLs that have been referenced.
    • Method Detail

      • getDisplayName

        public String getDisplayName()
        Returns the build data display name, optionally with SCM name. This string needs to be relatively short because it is displayed in a column with other short links. If it is lengthened, it causes the other data on the page to shift right. The page is then difficult to read.
        Specified by:
        getDisplayName in interface Action
        Specified by:
        getDisplayName in interface ModelObject
        Returns:
        build data display name
      • setIndex

        public void setIndex​(Integer index)
        Sets an identifier used to disambiguate multiple BuildData actions attached to a Run
        Parameters:
        index - the index, indexes less than or equal to 1 will be discarded.
      • getIndex

        @CheckForNull
        public Integer getIndex()
        Gets the identifier used to disambiguate multiple BuildData actions attached to a Run.
        Returns:
        the index.
      • getOwningRun

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        @CheckForNull
        public Run<?,​?> getOwningRun()
      • readResolve

        public Object readResolve()
      • hasBeenBuilt

        public boolean hasBeenBuilt​(org.eclipse.jgit.lib.ObjectId sha1)
        Return true if the history shows this SHA1 has been built. False otherwise.
        Parameters:
        sha1 - SHA1 hash of commit
        Returns:
        true if sha1 has been built
      • getLastBuild

        public Build getLastBuild​(org.eclipse.jgit.lib.ObjectId sha1)
      • saveBuild

        public void saveBuild​(Build build)
      • getLastBuildOfBranch

        public Build getLastBuildOfBranch​(String branch)
      • getLastBuiltRevision

        @Exported
        @CheckForNull
        public hudson.plugins.git.Revision getLastBuiltRevision()
        Gets revision of the previous build.
        Returns:
        revision of the last build. May be null will be returned if nothing has been checked out (e.g. due to wrong repository or branch)
      • getBuildsByBranchName

        @Exported
        public Map<String,​Build> getBuildsByBranchName()
      • setScmName

        public void setScmName​(String scmName)
      • getScmName

        @Exported
        public String getScmName()
      • addRemoteUrl

        public void addRemoteUrl​(String remoteUrl)
      • getRemoteUrls

        @Exported
        public Set<String> getRemoteUrls()
      • hasBeenReferenced

        public boolean hasBeenReferenced​(String remoteUrl)
      • getApi

        public Api getApi()
      • similarTo

        public boolean similarTo​(BuildData that)
        Like equals(Object) but doesn't check the URL as strictly, since those can vary while still representing the same remote repository.
        Parameters:
        that - the BuildData to compare with.
        Returns:
        true if the supplied BuildData is similar to this BuildData.
        Since:
        3.2.0
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object