jenkins.plugins.shiningpanda.utils
Class BuilderUtil

java.lang.Object
  extended by jenkins.plugins.shiningpanda.utils.BuilderUtil

public class BuilderUtil
extends Object


Constructor Summary
BuilderUtil()
           
 
Method Summary
static hudson.EnvVars getEnvironment(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener)
          Get the consolidated environment for the provided build.
static PythonInstallation getInstallation(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener, hudson.EnvVars environment, String name)
          Get the PYTHON installation.
static Python getInterpreter(hudson.Launcher launcher, hudson.model.BuildListener listener, hudson.EnvVars environment)
          Get the first available interpreter on the executor.
static Python getInterpreter(hudson.Launcher launcher, hudson.model.BuildListener listener, String home)
          Get an interpreter.
static List<Python> getInterpreters(hudson.Launcher launcher, hudson.model.BuildListener listener, hudson.EnvVars environment)
          Get the list of the valid interpreter on an executor.
static Virtualenv getVirtualenv(hudson.model.BuildListener listener, hudson.FilePath home)
          Get a VIRTUALENV from its home folder.
static boolean launch(hudson.Launcher launcher, hudson.model.BuildListener listener, hudson.FilePath pwd, hudson.EnvVars environment, Python interpreter, String nature, String command, boolean ignoreExitCode)
          Launch a command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuilderUtil

public BuilderUtil()
Method Detail

getEnvironment

public static hudson.EnvVars getEnvironment(hudson.model.AbstractBuild<?,?> build,
                                            hudson.model.BuildListener listener)
                                     throws IOException,
                                            InterruptedException
Get the consolidated environment for the provided build.

Parameters:
build - The build
listener - The build listener
Returns:
The consolidated environment
Throws:
IOException
InterruptedException

getInstallation

public static PythonInstallation getInstallation(hudson.model.AbstractBuild<?,?> build,
                                                 hudson.model.BuildListener listener,
                                                 hudson.EnvVars environment,
                                                 String name)
                                          throws IOException,
                                                 InterruptedException
Get the PYTHON installation.

Parameters:
build - The build
listener - The listener
environment - The environment
name - The name
Returns:
The PYTHON installation for this build
Throws:
IOException
InterruptedException

getInterpreter

public static Python getInterpreter(hudson.Launcher launcher,
                                    hudson.model.BuildListener listener,
                                    String home)
                             throws IOException,
                                    InterruptedException
Get an interpreter.

Parameters:
launcher - The launcher
listener - The listener
home - The home of the interpreter
Returns:
The interpreter if exists, else null
Throws:
IOException
InterruptedException

getVirtualenv

public static Virtualenv getVirtualenv(hudson.model.BuildListener listener,
                                       hudson.FilePath home)
                                throws IOException,
                                       InterruptedException
Get a VIRTUALENV from its home folder.

Parameters:
listener - The listener
home - The home folder
Returns:
The VIRTUALENV
Throws:
IOException
InterruptedException

launch

public static boolean launch(hudson.Launcher launcher,
                             hudson.model.BuildListener listener,
                             hudson.FilePath pwd,
                             hudson.EnvVars environment,
                             Python interpreter,
                             String nature,
                             String command,
                             boolean ignoreExitCode)
                      throws IOException,
                             InterruptedException
Launch a command.

Parameters:
launcher - The launcher
listener - The build listener
pwd - The working directory
environment - The environment
interpreter - The interpreter
nature - The nature of the command: PYTHON, shell, X shell
command - The command to execute
ignoreExitCode - Is the exit code ignored?
Returns:
true if was successful, else false
Throws:
IOException
InterruptedException

getInterpreter

public static Python getInterpreter(hudson.Launcher launcher,
                                    hudson.model.BuildListener listener,
                                    hudson.EnvVars environment)
                             throws IOException,
                                    InterruptedException
Get the first available interpreter on the executor.

Parameters:
launcher - The launcher
listener - The build listener
environment - The environment
Returns:
The first available interpreter
Throws:
IOException
InterruptedException

getInterpreters

public static List<Python> getInterpreters(hudson.Launcher launcher,
                                           hudson.model.BuildListener listener,
                                           hudson.EnvVars environment)
                                    throws IOException,
                                           InterruptedException
Get the list of the valid interpreter on an executor.

Parameters:
launcher - The launcher
listener - The build listener
environment - The environment
Returns:
The list of available interpreter
Throws:
IOException
InterruptedException


Copyright © 2004-2012. All Rights Reserved.