2016-07-19 15 views
2

私はあなたの大部分が笑っていると思う何かをしていると確信していますが、私はジェンキンスをマルチブランチパイプライン。私は問題を本質に単純化しました。空のノードJenkinsFileを持つ単一のブランチ(マスター)。私は2番目のプロジェクト、基本的にtrueを実行してビルドを検証する標準フリースタイルプロジェクトを持っています。JenkinsFileでマルチブランチパイプラインが動作しないように見える

は、ここに私のフリースタイルの設定です:

Repository URL: ssh://[email protected]:7999/dw/foobar.git 
Credentials: None 

BUILD 
    Execute Shell 
     Command: True 

そしてビルドが動作します。 (基本的には、レポ・チェックアウト、true実行され、ビルドが成功として報告されて

ここに私のマルチブランチビルド構成だが:。私は支店インデックスを行うと

BRANCH SOURCES 
    Project Repository: ssh://[email protected]:7999/dw/foobar.git 
    Credentials: None 

BUILD CONFIGURATION 
    Mode: By JenkinsFile 

、私は失敗し、ログを取得します言う:(レポのルートに座っている)

Started 
Setting origin to ssh://[email protected]:7999/dw/foobar.git 
Fetching origin... 
FATAL: Failed to recompute children of test » Jenkinsfile Test \ 
    java.lang.IllegalStateException: Cannot open session, connection is \ 
    not authenticated. 
    at com.trilead.ssh2.Connection.openSession(Connection.java:1127) 
    at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:32) 
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262) 
    at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161) 
    at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136) 
    at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122) 
    at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138) 
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130) 
    at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:678) 
    at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:174) 
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:146) 
    at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:294) 
    at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:157) 
    at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122) 
    at hudson.model.ResourceController.execute(ResourceController.java:98) 
    at hudson.model.Executor.run(Executor.java:410) 
Finished: FAILURE 

私JenkinsFileは言う:

node { 
} 

これは、私がマルチブランチパイプラインを実行していないときに、Jenkinsビルドスクリプトとしてこれを置くときに機能します。私はJenkinsが私のJenkinsFileを拾うことができることを確認したいだけです。

答えて

1

は、問題を発見:あなたは必見は、あなたが資格情報を使用する必要がない場合でも、設定された資格情報を持っています。フリースタイルジョブには資格情報が設定されておらず、この特定のGitリポジトリにアクセスできます。古いJenkinsサーバーでは、Gitプロジェクトのディレクトリと$HOME/.sshディレクトリの公開公開鍵/秘密鍵を使用しています。私たちのGitプロジェクトは資格情報を使用するものではなく、それらを必要としません。

ただし、Multibranch Pipelineには資格情報と非nullのJenkinsFileが必要です。私は最終的に資格を設定すると、ジョブは私がJenkinsFileに少なくとも1つのステップを追加する必要がありましたかそうでなければ、単一のビルドをトリガしません。)

関連する問題