0
the GitLab Docs을 따라 프로젝트 프로젝트의 CI가 다른 개인 종속성을 복제 할 수있게했습니다. 다음과 같이 별도의 쉘 스크립트 setup.sh
에GitLab 파이프 라인 : YML에서 작동하고 추출 된 SH에서 실패 함
before_script:
- 'which ssh-agent || (apt-get update -y && apt-get install openssh-client -y)'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
:
which ssh-agent || (apt-get update -y && apt-get install openssh-client -y)
eval $(ssh-agent -s)
ssh-add <(echo "$SSH_PRIVATE_KEY")
mkdir -p ~/.ssh
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
은 떠나 :
before_script:
- chmod 700 ./setup.sh
- ./setup.sh
난 후 점점 시작 :
가 작동되자, 나는
.gitlab-ci.yml
에서 추출
Cloning into '/root/Repositories/DependentProject'...
Warning: Permanently added 'gitlab.com,52.167.219.168' (ECDSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
어떻게 추출 된 스크립트에서 원래의 동작을 복제합니까?