2014-12-04 20 views
1

我試圖創建嵌套目錄和工作使用CloudBees的文件夾插件和詹金斯遠程API鏡像我的SVN倉庫的結構。使用與CloudBees的文件夾插件createItem遠程API來創建拼圖作業或子目錄

對於一個子目錄(假設我已經複製了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 /從/模式/名稱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界面 - 我可以輕鬆地移動,複製並創建嵌套的目錄和作業。

我使用詹金斯1.569與CloudBees的文件夾文件4.7插件。

回答

4

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' 
相關問題