结合使用createItem远程API和CloudBees文件夹插件来创建嵌套的作业或子目录

 天崖人B 发布于 2022-12-07 17:29

我正在尝试使用CloudBees Folder插件和Jenkins远程API创建嵌套目录和作业,以镜像我的SVN存储库的结构。

对于子目录(假设我已将config.xml复制到我的CWD中):

wget --no-proxy --auth-no-challenge --http-user=username --ask-password --header="Content-Type: application/xml" --post-file="dconfig.xml" 'http://ci.mycompany.com/jenkins/createItem?name=foo' 

作品。命令完成后,我在仪表板的顶层有了一个新创建的“ foo”文件夹。但是,当我尝试:

wget --no-proxy --auth-no-challenge --http-user=username --ask-password --header="Content-Type: application/xml" --post-file="dconfig.xml" 'http://ci.mycompany.com/jenkins/createItem?name=foo/bar' 

我收到“错误400:错误的请求”。我也尝试用“ name = / foo / bar”,“ name =%2Ffoo%2Fbar”和“ name = foo%2Fbar”代替,所有结果相同。

同样,当使用createItem / from / mode / name API复制内部文件夹时,也会得到类似的结果:

wget --no-proxy --auth-no-challenge --http-user=username --ask-password --header="Content-Type: application/xml" --post-file="dconfig.xml" 'http://ci.mycompany.com/jenkins/createItem?name=foo/bar&mode=copy&from=foo'

我发现这很不寻常,因为通过Web界面,我可以轻松移动,复制和创建嵌套的目录和作业。

我正在将Jenkins 1.569与CloudBees Folders 4.7插件一起使用。

1 个回答
  • name可能只是一个简单的名字。您要查找的端点在文件夹上,而不是在根级别上。从而

    wget --no-proxy --auth-no-challenge --http-user=username --ask-password --header="Content-Type: application/xml" --post-file="dconfig.xml" 'http://ci.mycompany.com/jenkins/job/foo/createItem?name=bar'
    

    2022-12-11 02:10 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有