Jenkins 参数动态获取目录里面的内容

Jenkins 参数动态获取目录里面的内容

假如我们想把一个目录下面的tar.gz文件作为jenkins参数,这个目录会实时更新,每次运行job的时候需要把目录里面的文件作为输入,这时候我们可以使用jenkins自带的Active Choices Parameter参数

在参数中写入一下代码

sh 复制代码
def filelist = [ ]
new File("/home/test").eachFile() {
    file->
    if (file.getName().endsWith(".gz"))
        filelist.add(file.getAbsolutePath())
}
return filelist
相关推荐
LSL666_1 天前
5 Repository 层接口
android·运维·elasticsearch·jenkins·repository
飞哥专栏2 天前
阿里云效 = Jenkins + Gitlab + 免费服务器
阿里云·gitlab·jenkins
linmengmeng_13142 天前
【Jenkins】Jenkins配置从节点 - Launch Agent
运维·servlet·jenkins
LSL666_2 天前
1 elasticSearch 和 IK分词器的本地下载
大数据·elasticsearch·jenkins
破烂pan3 天前
Jenkins 定时触发(cron)使用说明
运维·jenkins
liuyunshengsir3 天前
让 Elasticsearch Delete By Query 请求立即生效
大数据·elasticsearch·jenkins
❥ღ Komo·4 天前
Elasticsearch单机部署全指南
运维·jenkins
chevysky.cn4 天前
Jenkins自动部署CI/CD
运维·ci/cd·jenkins
Archy_Wang_15 天前
基于BaGet 构建NuGet私有库并实现类库打包到NuGet私有库
运维·jenkins
佐杰5 天前
Jenkins使用指南1
java·运维·jenkins