首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >无法通过Java插件hudson.plugins.git从邻居gogs容器中签出jenkins

无法通过Java插件hudson.plugins.git从邻居gogs容器中签出jenkins
EN

Stack Overflow用户
提问于 2019-02-21 02:24:24
回答 1查看 125关注 0票数 0

使用运行在ubuntu主机上的gogs/jenkins docker容器的简单CICD:

当我试图从gogs容器中获取我的git代码库时,我得到了这个错误:

代码语言:javascript
复制
git fetch --tags --progress http://gogs-repo:3000/repo.git   +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from http://gogs-repo:3000/repo.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:904)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1144)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1175)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120)
    at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:144)
    at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress http://gogs-repo:3000/repo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: fatal: repository 'http://gogs-repo:3000/repo.git/' not found

但是,当我登录到jenkins容器时,它从命令行工作:

代码语言:javascript
复制
jenkins@2425782a55e8:/$ cd /tmp   
jenkins@2425782a55e8:/tmp$ git clone http://gogs-repo:3000/repo.git
    Cloning into 'dfscoco'...
    remote: Enumerating objects: 7336, done.
    remote: Counting objects: 100% (7336/7336), done.
    remote: Compressing objects: 100% (4493/4493), done.
    remote: Total 7336 (delta 2236), reused 7199 (delta 2123)
    Receiving objects: 100% (7336/7336), 10.77 MiB | 0 bytes/s, done.
    Resolving deltas: 100% (2236/2236), done.

有什么想法吗?为什么java代码不能解析URL?

EN

回答 1

Stack Overflow用户

发布于 2019-02-21 03:11:25

所以答案是……

用于jenkins jvm的http的代理配置在管理插件/高级选项卡上。

要访问坞子网上的服务器,需要将其包括在字段中:

无代理主机 172.21.0.0/24

https://wiki.jenkins.io/display/JENKINS/JenkinsBehindProxy

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54792960

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档