public abstract class FileSystemProvisioner extends Object implements ExtensionPoint, Describable<FileSystemProvisioner>
RunListener. So this becomes like a special SCM type.
RunListener, which creates a snapshot if
someone else is interested in using a snapshot later.
|Modifier and Type||Class and Description|
Default implementation that doesn't rely on any file system specific capability, and thus can be used anywhere that Hudson runs.
|Modifier and Type||Field and Description|
|Constructor and Description|
|Modifier and Type||Method and Description|
Returns all the registered
When a project is deleted, this method is called to undo the effect of
Gets the descriptor for this instance.
Called very early in the build (before a build places any files in the workspace, such as SCM checkout) to provision a workspace for the build.
Obtains the snapshot of the workspace of the given build.
public static final FileSystemProvisioner DEFAULT
public abstract void prepareWorkspace(AbstractBuild<?,?> build, FilePath ws, TaskListener listener) throws IOException, InterruptedException
This method can prepare the underlying file system in preparation
for the later
FileSystemProvisioner.Default.snapshot(AbstractBuild, FilePath, TaskListener).
TODO : the method needs to be able to see the snapshot would
be later needed. In fact, perhaps we should only call this method
when Hudson knows that a snapshot is later needed?
public abstract void discardWorkspace(AbstractProject<?,?> project, FilePath ws) throws IOException, InterruptedException
prepareWorkspace(AbstractBuild, FilePath, TaskListener).
public abstract WorkspaceSnapshot snapshot(AbstractBuild<?,?> build, FilePath ws, String glob, TaskListener listener) throws IOException, InterruptedException
The state of the build when this method is invoked depends on
the project type. Most would call this at the end of the build,
but for example
MatrixBuild would call this after
SCM check out so that the state of the fresh workspace
can be then propagated to elsewhere.
If the implementation of this method needs to store data in a file system,
do so under
Run.getRootDir(), since the lifecycle of
the snapshot is tied to the life cycle of a build.
ws- New workspace should be prepared in this location. This is the same value as
build.getWorkspace()but passed separately for convenience.
glob- Ant-style file glob for files to include in the snapshot. May not be pertinent for all implementations.
public FileSystemProvisionerDescriptor getDescriptor()
Descriptor is a singleton for every concrete
implementation, so if
a.getClass() == b.getClass() then by default
a.getDescriptor() == b.getDescriptor() as well.
(In rare cases a single implementation class may be used for instances with distinct descriptors.)
Copyright © 2004–2020. All rights reserved.