jenkins/hudson can't connect to github repo

前端 未结 6 1799
不知归路
不知归路 2020-12-30 00:47

I am on Ec2 with the base amazon ami linux- I have installed jenkins but when I go to pull the repo from github I am given the following error:

Building in w         


        
6条回答
  •  萌比男神i
    2020-12-30 01:20

    I'm using a single jenkins machine to check out multiple github repositories and had similar problems when setting it up. What I ended up doing was configuring an SSH config file for jenkins so that SSH would automatically know which id file to associate with each repository.

    /var/lib/jenkins/.ssh/config:

    Host github-ABC
      HostName github.com
      User git
      IdentityFile /var/lib/jenkins/.ssh/id_rsa_ABC
    

    In the Jenkins project config under source code management, I used this as the repository name:

    git@github-ABC:user/repo.git
    

    Finally, I use the SSH public key as a deploy key in the github repository.

提交回复
热议问题