假设有一个 TFS 存储库
http://tfstta.example.com:8080/tfs/DefaultCollection/
并假设该存储库中有五个文件夹
文件夹 1、文件夹 2、文件夹 3、文件夹 4、文件夹 5
在使用 TFS 插件的 Jenkins 中,我可以像下面这样配置从存储库克隆单个文件夹,
这是单文件夹克隆配置(请查看)
如何一次克隆多个文件夹?
最后这个代码对我有用,感谢所有回复的人。
现在我可以通过更改项目路径在单个 groovy 文件中多次使用此代码。
withCredentials([string(credentialsId: 'PASSWORD-FORMASTAPPS', variable: 'PASSWORD')])
{
checkout([$class: 'TeamFoundationServerScm',
projectPath: '$/***Folder1 path***',
serverUrl: 'http://example1.com:8080/tfs/DefaultCollection',
useOverwrite: true,
useUpdate: true,
userName: 'TEN\\Uxxxxxxx',
password: hudson.util.Secret.fromString(PASSWORD),
workspaceName: 'Hudson-${JOB_NAME}-${NODE_NAME}'])
echo password
}
withCredentials([string(credentialsId: 'PASSWORD-FORMASTAPPS', variable: 'PASSWORD')])
{
checkout([$class: 'TeamFoundationServerScm',
projectPath: '$/***Folder2 path***',
serverUrl: 'http://example1.com:8080/tfs/DefaultCollection',
useOverwrite: true,
useUpdate: true,
userName: 'TEN\\Uxxxxxxx',
password: hudson.util.Secret.fromString(PASSWORD),
workspaceName: 'Hudson-${JOB_NAME}-${NODE_NAME}'])
echo password
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句