我正在尝试使用CloudBees文件夹插件和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文件夹4.7插件。
I am attempting to create nested directories and jobs mirroring the structure of my SVN repository using the CloudBees Folder plugin and Jenkins remote API.
For a subdirectory (assume I've copied the config.xml to my 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'works. When the command completes, I have a newly created "foo" folder in the top level of my dashboard. However when I try:
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'I get a "ERROR 400: Bad Request". I've also tried substituting "name=/foo/bar", "name=%2Ffoo%2Fbar", and "name=foo%2Fbar", all with the same results.
Likewise, I get a similar result when using the createItem/from/mode/name API to copy internal folders:
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'I find this very unusual since - through the web interface - I can easily move, copy, and create nested directories and jobs.
I am using Jenkins 1.569 with the CloudBees Folders 4.7 plugin.
最满意答案
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'name may only be a simple name. The endpoint you are looking for is on the folder, not at root level. Thus
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'更多推荐
发布评论