简体   繁体   English

如何动态填充svn文件夹中的文件,以便用户可以在jenkins作业中多选它们以进行参数化构建

[英]how to dynamically populate the files present in a svn folder so user could multiselect them in jenkins job for parametrized build

一种解决方案是使用svn list命令在文件中输出文件列表,然后使用该文件通过扩展选择插件显示要选择的文件。不确定如何在文件中获取输出。

The Subversion plugin itself comes with List Subversion tags (and more) parameter that you can select under This build is parameterized Subversion插件本身带有List Subversion标记(及更多)参数,您可以在此版本中选择该参数。

  • Give it a parameter name . 给它一个参数
  • Under Repository URL , enter the SVN repository location (not local filesystem) that contains the list of files. 在“ 存储库URL”下 ,输入包含文件列表的SVN存储库位置(不是本地文件系统)。
  • Provide credentials. 提供凭据。
  • You can leave everything else empty, and Save . 您可以将其他所有内容保留为空,然后保存

When you run the job, it will connect to the repo and populate the dropdown list with everything it sees at that location, including folders and files. 当您运行作业时,它将连接到存储库,并使用在该位置看到的所有内容(包括文件夹和文件)填充下拉列表。

If you want to exclude something, play around with the Tags filter 如果要排除某些内容,请使用“ 标签”过滤器

Answer: 回答:

Using groovy command,I was able to show the files present inside the directory upon clicking build with parameters on run time. 使用groovy命令,我可以在运行时单击带有参数的build来显示目录中存在的文件。 First install extended choice parameter plugin then select extended choice option ,select checkbox for selection and use following code after selecting groovy as source for populating the options in the form of checkbox. 首先安装扩展选择参数插件,然后选择扩展选择选项,选择复选框以进行选择,并在选择groovy作为以复选框形式填充选项的源之后使用以下代码。

def command = "svn list --non-interactive --no-auth-cache --username <> --password <>" def命令=“ svn列表-非交互式--no-auth-cache-用户名<>-密码<>

def proc = command.execute().text def proc = command.execute()。文本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM