Last active
November 20, 2020 07:25
-
-
Save superleeyom/a8b09e9a3e690270b2f5dd05e99630a8 to your computer and use it in GitHub Desktop.
Jenkins里利用groovy脚本获取指定文件夹名称
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static groovy.io.FileType.DIRECTORIES | |
def list = [""] | |
new File('/var/lib/jenkins/workspace/unprod').eachFile (DIRECTORIES) { file -> | |
def fileName = file.name; | |
if(fileName.startsWith('lumi_')){ | |
list.add(fileName + "/"); | |
} | |
} | |
return list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment