Class SetupDeployer
java.lang.Object
org.jenkinsci.plugins.slave_setup.SetupDeployer
Executes a deployment to all or a single node of the given fileset and
executes the command line.
- Author:
- Frederik Fromm /// Modified by @author ByteHeed, Mikel Royo Gutierrez, Aaron Giovannini
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Checks if this script should be executed on the target computer.static boolean
Copy localPath into remotePath and return boolean if operation succededstatic EnvVars
Gets the current enviroment variables for the given computerstatic int
executeScriptOnMaster
(TaskListener listener, String script, EnvVars enviroment) Executes the given script on Jenkins MasterNode with his envVars logging with given listenerstatic int
executeScriptOnSlave
(TaskListener listener, String script, FilePath root, EnvVars enviroment) Executes the given script on the given slave independently of their OSs.static String
Linked with Utils StringFy Useful to print object data into string
-
Constructor Details
-
SetupDeployer
public SetupDeployer()
-
-
Method Details
-
stringFy
Linked with Utils StringFy Useful to print object data into string -
copyFiles
public static boolean copyFiles(File localPath, FilePath remotePath) throws IOException, InterruptedException Copy localPath into remotePath and return boolean if operation succeded- Returns:
- Boolean , true if everything went OK
- Throws:
InterruptedException
- BrokenPipeIOException
- IO error while accesing disk
-
checkLabelsForComputerOrNull
Checks if this script should be executed on the target computer. If the computer is not set (on save of the jenkins configuration page) or if the label expression of the config matches with the given computer. -
executeScriptOnSlave
public static int executeScriptOnSlave(TaskListener listener, String script, FilePath root, EnvVars enviroment) throws IOException, InterruptedException Executes the given script on the given slave independently of their OSs.- Parameters:
listener
- TaskListener of the jobscript
- String script to executeroot
- Slave rootPath as jenkins.FilePathenviroment
- Enviroment variables for this job on this node. From SetupDeployer.createEnvVars(L)- Throws:
InterruptedException
- BrokenPipeIOException
- IO error while accesing disk
-
executeScriptOnMaster
Executes the given script on Jenkins MasterNode with his envVars logging with given listener- Parameters:
script
- Script to execute on Masterlistener
- Job's listener handleenviroment
- Enviroment's EnvVars from SetupDeployer.createEnvVarsForComputer(c)- Returns:
- int R result from Utils.multiOSexecutor Launcher return.
-
createEnvVarsForComputer
Gets the current enviroment variables for the given computer- Parameters:
c
- Computer instance.- Returns:
- Computer's EnvVars
-