Package hudson.plugins.cloneworkspace
Class CloneWorkspaceSCM
- java.lang.Object
-
- hudson.scm.SCM
-
- hudson.plugins.cloneworkspace.CloneWorkspaceSCM
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<SCM>
public class CloneWorkspaceSCM extends SCM
SCM
that inherits the workspace from another build throughWorkspaceSnapshot
.- Author:
- Kohsuke Kawaguchi, Andrew Bayer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CloneWorkspaceSCM.CloneWorkspaceSCMRevisionState
static class
CloneWorkspaceSCM.DescriptorImpl
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description String
criteria
The criteria by which to choose the build to inherit from.String
parentJobName
The job name from which we inherit the workspace.-
Fields inherited from class hudson.scm.SCM
PERMISSIONS, TAG
-
-
Constructor Summary
Constructors Constructor Description CloneWorkspaceSCM(String parentJobName, String criteria)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SCMRevisionState
calcRevisionsFromBuild(AbstractBuild build, Launcher launcher, TaskListener listener)
boolean
checkout(AbstractBuild build, Launcher launcher, FilePath workspace, BuildListener listener, File changelogFile)
protected PollingResult
compareRemoteRevisionWith(AbstractProject<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState _baseline)
ChangeLogParser
createChangeLogParser()
CloneWorkspaceSCM.DescriptorImpl
getDescriptor()
String
getParamParentJobName(AbstractBuild<?,?> build)
Get the parent job name.static File
getParentBuildFile(AbstractBuild b)
hudson.plugins.cloneworkspace.CloneWorkspaceSCM.Snapshot
resolve(String parentJob)
Obtains theWorkspaceSnapshot
object that thisSCM
points to, or throwsCloneWorkspaceSCM.ResolvedFailedException
upon failing.-
Methods inherited from class hudson.scm.SCM
_calcRevisionsFromBuild, _for, _for, all, buildEnvironment, buildEnvVars, calcRevisionsFromBuild, checkout, compareRemoteRevisionWith, createEmptyChangeLog, createEmptyChangeLog, getApi, getBrowser, getEffectiveBrowser, getKey, getModuleRoot, getModuleRoot, getModuleRoots, getModuleRoots, getType, guessBrowser, nullify, poll, pollChanges, postCheckout, postCheckout, processWorkspaceBeforeDeletion, processWorkspaceBeforeDeletion, requiresWorkspaceForPolling, supportsPolling
-
-
-
-
Field Detail
-
parentJobName
public String parentJobName
The job name from which we inherit the workspace.
-
criteria
public String criteria
The criteria by which to choose the build to inherit from. Can be "Any" (meaning most recent completed build), "Not Failed" (meaning most recent unstable/stable build), or "Successful" (meaning most recent stable build).
-
-
Method Detail
-
getParamParentJobName
public String getParamParentJobName(AbstractBuild<?,?> build)
Get the parent job name. Process it for parameters if needed.- Returns:
- Parent job name.
-
resolve
@NonNull public hudson.plugins.cloneworkspace.CloneWorkspaceSCM.Snapshot resolve(String parentJob) throws hudson.plugins.cloneworkspace.CloneWorkspaceSCM.ResolvedFailedException
Obtains theWorkspaceSnapshot
object that thisSCM
points to, or throwsCloneWorkspaceSCM.ResolvedFailedException
upon failing.- Parameters:
parentJob
- Processed parent job name.- Returns:
- never null.
- Throws:
hudson.plugins.cloneworkspace.CloneWorkspaceSCM.ResolvedFailedException
-
checkout
public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspace, BuildListener listener, File changelogFile) throws IOException, InterruptedException
- Overrides:
checkout
in classSCM
- Throws:
IOException
InterruptedException
-
createChangeLogParser
public ChangeLogParser createChangeLogParser()
- Specified by:
createChangeLogParser
in classSCM
-
getDescriptor
public CloneWorkspaceSCM.DescriptorImpl getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<SCM>
- Overrides:
getDescriptor
in classSCM
-
getParentBuildFile
public static File getParentBuildFile(AbstractBuild b)
-
calcRevisionsFromBuild
public SCMRevisionState calcRevisionsFromBuild(AbstractBuild build, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
- Overrides:
calcRevisionsFromBuild
in classSCM
- Throws:
IOException
InterruptedException
-
compareRemoteRevisionWith
protected PollingResult compareRemoteRevisionWith(AbstractProject<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState _baseline) throws IOException, InterruptedException
- Overrides:
compareRemoteRevisionWith
in classSCM
- Throws:
IOException
InterruptedException
-
-