Aar*_*lee 12 windows git github jenkins
我在Win 2008服务器计算机上设置Jenkins,并且在配置Jenkins以连接到GitHub时遇到一些麻烦.我收到以下错误:
Command "git.exe fetch -t git@github.com:USER/REPO.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: Permission denied (publickey).
fatal: The remote end hung up unexpectedly
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:950)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:908)
at hudson.FilePath.act(FilePath.java:758)
at hudson.FilePath.act(FilePath.java:740)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:908)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1184)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:537)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:425)
at hudson.model.Run.run(Run.java:1376)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:175)
Run Code Online (Sandbox Code Playgroud)
我检查过的事情
Jenkins配置设置
msysgit工作,但CMD提示不会 当我导航到有效的仓库并从DOS提示符执行命令时,它也会失败.
你知道我可能缺少什么吗?
谢谢你的帮助.
Von*_*onC 13
正如我评论的那样,HOME在使用ssh协议时,指定环境变量是关键.
由于Windows没有HOME,因此您需要将其明确定义到您想要的任何目录.
但是,Vestnik评论道:
我已指定
HOME在windows slave节点上覆盖以指向它C:\jenkins.
我已经把正确id_rsa的下C:\jenkins\.ssh,但仍然有这个问题.
我的奴隶代理在SYSTEM帐户下作为服务运行.
两个建议:
set',以便检查在与SYSTEM帐户一起使用时是否定义了HOME.
id_rsa和:您需要公钥和私钥ssh.(如" 带有ssh问题的git clone "中所述)id_rsa.pub%HOME%\.ssh如果你有一个参数化的构建,你也可以定义HOME这种方式,并检查你的奴隶是否选择了正确的值HOME:

小智 5
jnskins中有两个与ssh相关的插件可以使用: 发布SSH和Jenkins SSH插件.
第一个插件提供了设置全局ssh密钥的可用性,第二个插件提供了设置各种ssh密钥的可用性.
接下来,您需要再安装两个将在项目配置GitHub插件和Jenkins Git插件中使用的插件.
GitHub插件将用于设置GitHub项目.Jenkins Git插件将用于设置"存储库的URL"和其他东西,如分支等.
所有插件都可以从Jenkins插件管理器中的选项卡中获得.
Jenkins配置:
Jenkins SSH插件提供了为每个主机设置私钥的可用性,第二个插件为全局主机完成了工作.
如果使用Jenkins SSH插件,则在SSH远程主机中写入主机,用户,密码和私钥的路径.
如果使用Publish Over SSH,则在SSH设置中编写密码并粘贴私钥或写入路径.
项目配置是:
GitHub项目https://github.com/GitUser/iOS-project/
*源代码管理
- > Git
- > - >存储库
- > - > - >存储库的URL:git@github.com:GitUser /iOS-project.git
- 由您配置分支或采用默认分支 -
*构建触发器
- >轮询SCM - 已安装 -
- >时间表:*****
*构建
- >已执行Shell
-> -> Command: xcodebuild -target iOS-project -configuration AdHoc -sdk iphoneos5.0 clean
-> -> Command: agvtool new-version -all $BUILD_NUMBER
-> -> Command: xcodebuild -target iOS-project -configuration AdHoc -sdk iphoneos5.0
-> -> Command: xcrun -sdk iphoneos5.0 PackageApplication -v $WORKSPACE/build/AdHoc-iphoneos/iOS-project.app -o $WORKSPACE/build/AdHoc-iphoneos/iOS-project-$BUILD_NUMBER.ipa PROVISIONING_PROFILE="<provisioning profile>"
-> -> Command: curl http://testflightapp.com/api/builds.json -F file=@$WORKSPACE/build/AdHoc-iphoneos/iCushion-1.0-$BUILD_NUMBER.ipa -F api_token=<api_token> -F team_token=<team_token> -F notes="This is an autodeploy build from Jenkins!" -F notify=True -F distribution_lists="<distributedlist 1>, <distributedlist 2>"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
28400 次 |
| 最近记录: |