因此,我在Bitbucket上有一个git repo,作为Concourse工作的一部分,我需要对其进行监视。该存储库可用,并且我的〜/ .ssh文件夹中具有SSH密钥,并具有正确的权限(600)。在我的机器上,我可以运行'git clone git@bitbucket.org:/。git'命令,并成功克隆存储库。但是,当我尝试将其作为Concourse资源进行监视时,它将失败。我究竟做错了什么?我是否缺少配置选项?
以下是我的管道,这很基本。
resources:
- name: dc
type: git
source:
branch: master
uri: git@bitbucket.org:<company>/<repo>.git
jobs:
- name: Build-docker
plan:
- get: dc
trigger: true
- task: build-image
config:
platform: linux
image_resource:
type: docker-image
source:
repository: ubuntu
run:
path: uname
args: ['r']
我在GUI上看到的内容
stderr:
Cloning into '/tmp/git-resource-repo-cache'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
在本地运行git-clone时看到的内容:
git clone git@bitbucket.org:<company>/<repo>.git
Cloning into 'repo'...
Warning: Permanently added the RSA host key for IP address '18.205.93.1' to the list of known hosts.
remote: Counting objects: 50985, done.
remote: Compressing objects: 100% (26500/26500), done.
Receiving objects: 100% (50985/50985), 6.65 MiB | 11.19 MiB/s, done.
remote: Total 50985 (delta 39577), reused 31398 (delta 24283)
Resolving deltas: 100% (39577/39577), done.
答案 0 :(得分:1)
您是否已将您的私钥用于某种secrets.yml
文件中?并在设置管道时将其加载?
例如
resources:
- name: dc
type: git
source:
branch: master
uri: git@bitbucket.org:<company>/<repo>.git
github_key: ((private_key))
然后尝试
fly -t "org" set-pipeline -p "pipeline_name" -c "pipeline.yml file name" --load-vars-from "secrets_file.yml"
这可能无法正常工作,因为我遇到类似的问题,但是您可以尝试使用这种方式