Невозможно оформить заказ в jenkins из контейнера соседних gogs через плагин Java hudson.plugins.git - PullRequest
0 голосов
/ 20 февраля 2019

Простой CICD с использованием контейнера докера gogs / jenkins, работающего на хосте Ubuntu:

Когда я пытаюсь получить мое git-репо из контейнера gogs, я получаю эту ошибку:

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, он работает из командной строки:

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.

Есть идеи ??Почему ява-код не может разрешить URL?

1 Ответ

0 голосов
/ 20 февраля 2019

Таким образом, ответ ....
Конфигурация прокси-сервера для http, используемого для jvkins jenkins, находится на Управление плагинами / вкладка Advanced .

Для доступа к серверу на подсеть Docker необходимо указать в поле:

Нет прокси-хоста 172.21.0.0/24

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

...