簡體   English   中英

Jenkins 聲明性管道因 git 檢出步驟而失敗

[英]Jenkins declarative pipeline fails with git checkout step

以下是片段


    stage('Git checkout') {
      steps {
        git branch: '${params.branchName}', url: 'my_git_repository_url.git'
      }
    }

執行后,我收到以下錯誤

Running in Durability level: MAX_SURVIVABILITY
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 18: Invalid parameter "branch", did you mean "name"? @ line 18, column 13.
           git branch: 'name_of_git_branch', url: 'https://my_git_repository_url.git'
               ^

WorkflowScript: 18: Invalid parameter "url", did you mean "name"? @ line 18, column 44.
   ranch: 'bas-download-breaks', url: 'http
                                 ^

我在 jenkins 服務器中安裝了 git 和工作流聚合器插件。 任何有關此類問題的線索都會有所幫助。

這里的問題是 workflow-aggregator:2.6 依賴於 git-client 插件。 在使用工作流聚合器啟動 jenkins 后手動安裝插件“git”,並且在手動安裝 git 后服務器從未重新啟動。

因此,pipeilne 假設使用git-client而不是git插件。 jenkins 重新啟動后,git 插件工作,上述結帳步驟工作。

由於這與發現時提出的唯一答案不同,因此我發布此發現,因為它對我有用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM