我想知道如何使用IBM Bluemix Dev Ops Services構建包含私有git子模塊的項目。Bluemix Dev Ops:使用私有git子模塊構建項目
在我的管道,我有型「Shell腳本」一「建設」的工作:
#!/bin/bash
git submodule init
git submodule update --recursive
但我的子模塊包括一些私有倉庫的,我也得到:
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中。
我正在部署的應用程序的回購託管在GitHub上。私人子模塊託管在BitBucket上。
更新
我試圖用在構建控制檯我的私鑰,但沒有奏效:
echo "... my private key ..." >> ~/.ssh/throwaway_key
chmod 400 ~/.ssh/throwaway_key
ssh-agent bash -c 'ssh-add ~/.ssh/throwaway_key; git submodule update --recursive'
是它不工作,因爲我是一個碼頭工人容器內?我需要更新/etc/ssh/ssh_config
嗎?我沒有這份工作運行中的容器內訪問該
更新2
我也嘗試沒有成功。
echo "Host bitbucket.org
Hostname bitbucket.org
IdentityFile ~/.ssh/throwaway_key
IdentitiesOnly yes" >> ~/.ssh/config
你能不能將你的密鑰粘貼到構建shell腳本中並讓它在那裏可用?否則,Bluemix DevOps不會提供對SSH密鑰的支持 –
@BenRondeau我根據您的建議嘗試了一些東西。你能看到我的更新並給我任何其他建議嗎? –
您是否有任何錯誤輸出?還是它默默地失敗了? –