2016-09-15 19 views
1

所以我有一個linux節點上的Jenkins master,並使用windows代理進行一些工作。我正在使用工作流程插件。就代理使用而言,該腳本看起來像這樣 。git可執行文件的類型混亂,用於linux的master和windows代理

node('windows_agent'){ 
    stage name: 'SCM checkout' 
     //groovy code to checkout repo with app's source code with polling enabled (by using the Git.exe 1.9 for Windows) 
     // Another groovy code to checkout repo with Jenkins's workflow source code withOUT polling enabled  

    stage name: '......' 
    // continues 
    . 
    . 
    . 
    . 

    } 

在作業配置頁面中,我選擇了'Pipeline script from SCM'並指定了詹金斯的工作流程庫git的URL。它也設置輪詢 scm每5分鐘使用Linux的Git(因爲我必須選擇一個)。我選擇linux git作爲主節點是Linux節點。現在,git輪詢失敗的應用程序 源代碼回購,因爲它試圖在Linux節點中使用Windows git.exe。如果我將這個git可執行文件更改爲使用Groovy代碼中的linux代碼,那麼實際的工作流程執行 將在嘗試檢出windows代理中的代碼時失敗。

回答