【问题标题】:Loading private repository submodules in Jenkins Project在 Jenkins 项目中加载私有存储库子模块
【发布时间】:2014-10-21 12:55:31
【问题描述】:

我目前正试图让 Jenkins 加入

这是我从 Jenkins 控制台的输出.. 很明显插件正在尝试使用直接项目名称.. 未设置为使用密钥。

  Started by user '__'
Building in workspace /var/lib/jenkins/workspace/JENKINSPROJECTNAME
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.PROJECTREPO.url github-deploy-project:Owner/ProjectName # timeout=10
Fetching upstream changes from github-deploy-project:Owner/ProjectName
 > git --version # timeout=10
using GIT_SSH to set credentials 
 > git fetch --tags --progress github-deploy-project:Owner/ProjectName +refs/heads/*:refs/remotes/ProjectName/*
 > git rev-parse refs/remotes/ProjectName/master^{commit} # timeout=10
 > git rev-parse refs/remotes/ProjectName/ProjectName/master^{commit} # timeout=10
Checking out Revision ______________ (refs/remotes/ProjectName/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f _____________
 > git rev-list ________________ # timeout=10
 > git remote # timeout=10
 > git submodule init # timeout=10
 > git submodule sync # timeout=10
 > git config --get remote.ProjectName.url # timeout=10
 > git submodule update --init --recursive
FATAL: Command "git submodule update --init --recursive" returned status code 1:
stdout: 
stderr: Cloning into 'submodule/FolderName'...
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/Owner/SubModuleProject.git/'
Clone of 'https://github.com/Owner/SubModuleProject.git' into submodule path 'submodule/FolderName' failed

hudson.plugins.git.GitException: Command "git submodule update --init --recursive" returned status code 1:
stdout: 
stderr: Cloning into 'submodule/FolderName'...
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/Owner/SubModuleProject.git/'
Clone of 'https://github.com/Owner/SubModuleProject.git' into submodule path 'submodule/FolderName' failed

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1407)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$400(CliGitAPIImpl.java:87)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:742)
    at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:77)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:920)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1252)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:615)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:524)
    at hudson.model.Run.execute(Run.java:1706)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:232)

【问题讨论】:

    标签: git github jenkins jenkins-plugins ssh-keys


    【解决方案1】:

    Git 正在递归获取主项目基础的 .gitmodules 中定义的 repos。

    你有几种方法可以解决这个问题:

    • 更改 .gitmodules 以引用所需的 repo 副本 访问控制。
    • fork github 存储库,并更改所需的访问权限 控制。
    • 删除 .submodule 中的条目并将其复制到 主要回购。
    • 如果您控制有问题的 github 存储库,请配置 ~jenkins/.ssh/config 身份文件

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-24
      • 1970-01-01
      • 1970-01-01
      • 2020-05-09
      相关资源
      最近更新 更多