Package jenkins.plugins.git
Class AbstractGitSCMSource.SpecificRevisionBuildChooser
- java.lang.Object
-
- hudson.plugins.git.util.BuildChooser
-
- jenkins.plugins.git.AbstractGitSCMSource.SpecificRevisionBuildChooser
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<BuildChooser>
,Serializable
- Enclosing class:
- AbstractGitSCMSource
public static class AbstractGitSCMSource.SpecificRevisionBuildChooser extends BuildChooser
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.plugins.git.util.BuildChooser
gitSCM
-
-
Constructor Summary
Constructors Constructor Description SpecificRevisionBuildChooser(AbstractGitSCMSource.SCMRevisionImpl revision)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<hudson.plugins.git.Revision>
getCandidateRevisions(boolean isPollCall, String singleBranch, org.jenkinsci.plugins.gitclient.GitClient git, TaskListener listener, BuildData buildData, BuildChooserContext context)
Get a list of revisions that are candidates to be built.Build
prevBuildForChangelog(String branch, BuildData data, org.jenkinsci.plugins.gitclient.GitClient git, BuildChooserContext context)
Determines the baseline to compute the changelog against.-
Methods inherited from class hudson.plugins.git.util.BuildChooser
all, allApplicableTo, getCandidateRevisions, getCandidateRevisions, getDescriptor, getDisplayName, prepareWorkingTree, prevBuildForChangelog, prevBuildForChangelog
-
-
-
-
Constructor Detail
-
SpecificRevisionBuildChooser
public SpecificRevisionBuildChooser(AbstractGitSCMSource.SCMRevisionImpl revision)
-
-
Method Detail
-
getCandidateRevisions
public Collection<hudson.plugins.git.Revision> getCandidateRevisions(boolean isPollCall, String singleBranch, org.jenkinsci.plugins.gitclient.GitClient git, TaskListener listener, BuildData buildData, BuildChooserContext context) throws hudson.plugins.git.GitException, IOException, InterruptedException
Get a list of revisions that are candidates to be built.This method is invoked on the node where the workspace exists, which may not be the controller.
- Overrides:
getCandidateRevisions
in classBuildChooser
- Parameters:
isPollCall
- true if this method is called from pollChanges.singleBranch
- contains the name of a single branch to be built this will be non-null only in the simple case, in advanced cases with multiple repositories and/or branches specified then this value will be null.git
- Used for invoking Gitlistener
- build logbuildData
- build data to be used Information that captures what we did during the last build.context
- Object that provides access back to the model object. This is because the build chooser can be invoked on an agent where there's no direct access to the build/project for which this is invoked. IfisPollCall
is false, then call back to both project and build are available. IfisPollCall
is true, then only the callback to the project is available as there's no contextual build object.- Returns:
- the candidate revision. Can be an empty set to indicate that there's nothing to build.
- Throws:
hudson.plugins.git.GitException
- on git errorIOException
- on input or output errorInterruptedException
- when interrupted
-
prevBuildForChangelog
public Build prevBuildForChangelog(String branch, @Nullable BuildData data, org.jenkinsci.plugins.gitclient.GitClient git, BuildChooserContext context) throws IOException, InterruptedException
Determines the baseline to compute the changelog against.BuildChooser.getCandidateRevisions(boolean, String, hudson.plugins.git.IGitAPI, TaskListener, BuildData, BuildChooserContext)
determine what commits can be subject for a build, and for each commit it determines the branches that contribute to them.Once
GitSCM
picks up a specificRevision
to build, for each branch, in that revision, this method is called to compute the changelog.- Overrides:
prevBuildForChangelog
in classBuildChooser
- Parameters:
branch
- The branch name.data
- Information that captures what we did during the last build.git
- Used for invoking Gitcontext
- Object that provides access back to the model object. This is because the build chooser can be invoked on an agent where there's no direct access to the build/project for which this is invoked.- Returns:
- candidate revision. Can be an empty set to indicate that there's nothing to build.
- Throws:
IOException
- on input or output errorInterruptedException
- when interrupted
-
-