2015-06-17 106 views
1

我需要自動化jenkins,使用本地用戶/密碼從python登錄jenkins非常容易。但是我們的jenkins服務器配置了組合體,所以我無法通過jenkins.jenkins python模塊登錄。任何建議可以建議如何用第三方sso配置登錄到jenkins服務器。
python api文檔:https://python-jenkins.readthedocs.org/en/latest/api.htmlpython jenkins.jenkins模塊:如何用第三方sso登錄jenkins

我可以使用任何其他模塊。

import jenkins 
j = jenkins.Jenkins('http://your_url_here', 'username', 'password') 
j.get_jobs() 

回答

0

成功通過第三方sso登錄後。從這個頁面獲取API Token(http:/// user // configure)並使用api標記作爲用戶名密碼登錄到Jenkins服務器。

import jenkins 
j = jenkins.Jenkins('http://your_url_here', 'username', 'password') 
相關問題