public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static List<Computer> |
getAllActiveSlaves()
Gets all active (ONLINE) slaves running on the all jenkins instance.
|
static boolean |
labelMatches(String pattern,
Computer slave)
Improved function, this will check if label matches with one of slave labels or
Will match if some reggex matches with all slave labels
https://github.com/beerdn/slave-setup-plugin/commit/511b19f24d6a59902c6d6b6c838c7c8a85674d85
|
static int |
multiOsExecutor(TaskListener listener,
String script,
FilePath root,
EnvVars enviroment)
Added Unix and Win32 Platform Handling to add support to Windows OS by using
the BatchFile obj letting us to configure automated WIN machines on our
Integration enviroments.
|
static String |
osLineSeparator(boolean isUnix)
With given boolean for isUnix operating System, returns OS end of line
separator
|
static String |
osLineSeparator(String someFullPath)
Given full path from OS, returns os End of line separator
|
static String |
stringFy(Object obj)
Idea from https://stackoverflow.com/questions/1526826/printing-all-variables-value-from-a-class
This class prints entire properies, methods, from any object, Useful to debug unkown objects
|
public static String osLineSeparator(boolean isUnix)
isUnix
- boolean, true for Unix OSpublic static String osLineSeparator(String someFullPath)
someFullPath
- String with non relative path to any file/folderpublic static int multiOsExecutor(TaskListener listener, String script, FilePath root, EnvVars enviroment) throws IOException, InterruptedException
listener
- TaskListener, connected to slave computer, will give us channelscript
- String pure script content to be executed in Abstracted OSroot
- FilePath (Jenkins) from Computer to be executedenviroment
- EnvVars, not necesary, but will be included in Computer before be executedIOException
- if failed to read/write some fileInterruptedException
- User request Disconnect/Cancelpublic static boolean labelMatches(String pattern, Computer slave)
pattern
- String pattern containing one label or reggexslave
- Computer where will check if pattern matchspublic static String stringFy(Object obj)
obj
- Object to get verbose contentCopyright © 2016–2023. All rights reserved.