문제

문제

Jenkins에서 내 응용 프로그램을 구축하려고 시도하고있는 GitHub에서 개인 repo에 있습니다. 또한 개인 서브 모듈이 있습니다.

IT의 자격 증명을 설정하여 Jenkins의 개인 저장소를 복제 할 수 있지만 Jenkins는 Submodule을 복제 할 수 없습니다.

에 실패한 빌드의 출력이 있습니다.
Started by an SCM change
Building in workspace /var/lib/jenkins/jobs/Project/workspace
Fetching changes from the remote Git repository
Fetching upstream changes from git@github.com:user/repogit
using GIT_SSH to set credentials 
Checking out Revision 9cc99b67cc676d0ea8ccd489a8327f5c6dbb8d7f (origin/branch)
[workspace] $ /bin/sh -xe /tmp/hudson2710403018107019432.sh
+ git submodule update --init --recursive
Initialized empty Git repository in /var/lib/jenkins/jobs/repository/submodule/.git/
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
Clone of 'git@github.com:user/submodule.git' into submodule path 'repository/submodule/' failed
Build step 'Execute shell' marked build as failure
Discard old builds...
#156 is removed because status FAILURE is not to be kept
Publishing Clover coverage report...
No Clover report will be published due to a Build Failure
Sending e-mails to: 
Finished: FAILURE
.

jenkins

에서 내가하려고했던 것입니다

  • 는 성공하지 못한다.
  • 추가 동작 "고급 하위 모듈 동작"을 설정하려고 시도했다.
  • 는 phpUnit로 테스트를 실행하기 전에 새 단계를 설정하려고 시도했습니다.

git submodule update --init --recursive

  • 테스트중인 주요 저장소뿐만 아니라, 운이 아니라,

jenkins가 서브 모듈 저장소를 찾을 수 없다는 오류가 발생합니다.

어떻게 해결할 수 있습니까?

(사용자 이름, 경로 및 저장소가 올바른지, 여기에 게시하도록 변경했습니다)

도움이 되었습니까?

해결책

해결되었습니다.내 자격 증명에서 파일을 넣는 대신 직접 SSH 키 ( "직접 입력"옵션)을 사용했습니다.

~ / .ssh에 키 (공개 및 비공개)를 넣고 "Jenkins Master ~ / .ssh"에서 "옵션으로 자격 증명을 변경했습니다.

해당 문제는 해석이 주 저장소에 지정된 자격 증명을 사용하지 않았으며 기본 SSH 키 (.ssh / id_rsa)를 사용하려고 시도했습니다.

다른 해결책은 -i my_key를 git 하위 모듈 단계에 전달하는 것입니다 (키가 기본 경로 (~ / .ssh / id_rsa)에 있지 않은 경우에만 필요합니다)

또한 키에 올바른 권한을주는 것을 잊지 마십시오. 내 경우 :

chown apache ~/.ssh/id_rsa*
chmod 700 ~/.ssh/id_rsa*
.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top