-
New Feature
-
Resolution: Won't Do
-
Minor
-
None
It would be useful if the groovy postbuild plugin had a method to check if a file with a given pattern existed in the jenkins workspace. This could be used to easily determine the state of a build by looking for marker files.
Possible interface (If Jenkins has some concept of a FileTree / FileCollection that could be used):
// searches the entire workspace for file names that match regexp fileExists(String regexp) // searches for files in dir recursively for file names that match regexp fileExists(File dir, String regexp)
Example:
if (manager.fileExists(new File("build/customverification/"), ".*\\.failed")) { manager.addBadge(...) manager.buildUnstable(); ... }