jenkins.plugins.shiningpanda.workspace
Class Workspace

java.lang.Object
  extended by jenkins.plugins.shiningpanda.workspace.Workspace
Direct Known Subclasses:
MasterWorkspace, SlaveWorkspace

public abstract class Workspace
extends Object


Field Summary
static String BASENAME
          Base name of the workspace under the node.
protected static String BOOTSTRAP
          Name of the BUILDOUT bootstrap module.
static String PACKAGES
          Base name of the folder containing the packages.
protected static String VIRTUALENV
          Name of the VIRTUALENV module.
 
Constructor Summary
Workspace(hudson.FilePath home)
          Constructor using fields.
 
Method Summary
protected  void delete()
          Delete this workspace without throwing exceptions on error.
static void delete(hudson.model.Item item)
          Clean item related workspaces.
static void delete(hudson.model.Item item, String name)
          Clean item related workspaces.
static Workspace fromBuild(hudson.model.AbstractBuild<?,?> build)
          Create a workspace from the build.
static Workspace fromHome(hudson.FilePath home)
          Create the workspace from its home folder.
static Workspace fromNode(hudson.model.Node node, hudson.model.AbstractProject<?,?> project, String name)
          Create a workspace from the node and the project.
static Workspace fromProject(hudson.model.Project<?,?> project, String name)
          Get a workspace from a project.
abstract  hudson.FilePath getBootstrapPy()
          Get the BUILDOUT bootstrap module file on executor.
 hudson.FilePath getBuildoutHome(String name)
          Get the VIRTUALENV home dedicated to BUILDOUT for the provided PYTHON installation name.
 hudson.FilePath getHome()
          Get the home folder of this workspace.
 hudson.FilePath getMasterBootstrapPy()
          Get the BUILDOUT bootstrap file on master.
 hudson.FilePath getMasterPackagesDir()
          Get the folder on master where user can put some packages to avoid downloads when creating a VIRTUALENV.
 hudson.FilePath getMasterVirtualenvPy()
          Get the VIRTUALENV module file on master.
abstract  hudson.FilePath getPackagesDir()
          Get the folder on executor containing the packages provided by user to avoid downloads when creating a VIRTUALENV.
 hudson.FilePath getToolsHome()
          Get the VIRTUALENV home for this workspace, where TOX (or other tools) can be installed for instance.
 hudson.FilePath getVirtualenvHome(String name)
          Get the VIRTUALENV home for the provided VIRTUALENV name.
abstract  hudson.FilePath getVirtualenvPy()
          Get the VIRTUALENV module file on executor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASENAME

public static String BASENAME
Base name of the workspace under the node.


PACKAGES

public static String PACKAGES
Base name of the folder containing the packages.


VIRTUALENV

protected static String VIRTUALENV
Name of the VIRTUALENV module.


BOOTSTRAP

protected static String BOOTSTRAP
Name of the BUILDOUT bootstrap module.

Constructor Detail

Workspace

public Workspace(hudson.FilePath home)
Constructor using fields.

Parameters:
home - The home folder of the workspace.
Method Detail

getHome

public hudson.FilePath getHome()
Get the home folder of this workspace.

Returns:
The home folder

getMasterVirtualenvPy

public hudson.FilePath getMasterVirtualenvPy()
Get the VIRTUALENV module file on master.

Returns:
The VIRTUALENV module file

getVirtualenvPy

public abstract hudson.FilePath getVirtualenvPy()
                                         throws IOException,
                                                InterruptedException
Get the VIRTUALENV module file on executor.

Returns:
The VIRTUALENV module file
Throws:
IOException
InterruptedException

getMasterBootstrapPy

public hudson.FilePath getMasterBootstrapPy()
Get the BUILDOUT bootstrap file on master.

Returns:
The BUILDOUT bootstrap module file

getBootstrapPy

public abstract hudson.FilePath getBootstrapPy()
                                        throws IOException,
                                               InterruptedException
Get the BUILDOUT bootstrap module file on executor.

Returns:
The BUILDOUT bootstrap module file
Throws:
IOException
InterruptedException

getMasterPackagesDir

public hudson.FilePath getMasterPackagesDir()
                                     throws IOException,
                                            InterruptedException
Get the folder on master where user can put some packages to avoid downloads when creating a VIRTUALENV.

Returns:
The packages folder
Throws:
IOException
InterruptedException

getPackagesDir

public abstract hudson.FilePath getPackagesDir()
                                        throws IOException,
                                               InterruptedException
Get the folder on executor containing the packages provided by user to avoid downloads when creating a VIRTUALENV.

Returns:
The packages folder
Throws:
IOException
InterruptedException

getToolsHome

public hudson.FilePath getToolsHome()
Get the VIRTUALENV home for this workspace, where TOX (or other tools) can be installed for instance.

Returns:
The VIRTUALENV home

getVirtualenvHome

public hudson.FilePath getVirtualenvHome(String name)
Get the VIRTUALENV home for the provided VIRTUALENV name.

Parameters:
name - The name of the VIRTUALENV
Returns:
The VIRTUALENV home

getBuildoutHome

public hudson.FilePath getBuildoutHome(String name)
Get the VIRTUALENV home dedicated to BUILDOUT for the provided PYTHON installation name.

Parameters:
name - The name of the PYTHON installation
Returns:
The VIRTUALENV home

delete

protected void delete()
Delete this workspace without throwing exceptions on error.


fromHome

public static Workspace fromHome(hudson.FilePath home)
Create the workspace from its home folder.

Parameters:
home - The home folder
Returns:
The workspace

fromBuild

public static Workspace fromBuild(hudson.model.AbstractBuild<?,?> build)
Create a workspace from the build.

Parameters:
build - The build
Returns:
The workspace

fromProject

public static Workspace fromProject(hudson.model.Project<?,?> project,
                                    String name)
Get a workspace from a project.

Parameters:
project - The project
name - Base name used to compute the workspace location. If null then use the name of the project
Returns:
The workspace if exists, else null

fromNode

public static Workspace fromNode(hudson.model.Node node,
                                 hudson.model.AbstractProject<?,?> project,
                                 String name)
Create a workspace from the node and the project.

Parameters:
node - The node
project - The project
name - Base name used to compute the workspace location. If null then use the name of the project
Returns:
The workspace

delete

public static void delete(hudson.model.Item item)
Clean item related workspaces.

Parameters:
item - The item

delete

public static void delete(hudson.model.Item item,
                          String name)
Clean item related workspaces.

Parameters:
item - The item
name - The name to use to compute the workspace location


Copyright © 2004-2012. All Rights Reserved.