Bluemix Dev Ops:使用私有git子模块构build项目

我想知道如何使用IBM Bluemix Dev Ops Services构build一个包含私有git子模块的项目。

在我的pipe道中,我有一个types为'Shell Script'的'Build'作业:

#!/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中。

我正在部署的应用程序的回购托pipe在GitHub上。 私人子模块托pipe在BitBucket上。

更新

我试图在构build控制台中使用我的私钥,但它不起作用:

 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' 

是不是因为我在docker集装箱内工作? 我必须更新/etc/ssh/ssh_config吗? 我无法访问此作业运行的容器内部。

更新2

我也试过没有成功:

 echo "Host bitbucket.org Hostname bitbucket.org IdentityFile ~/.ssh/throwaway_key IdentitiesOnly yes" >> ~/.ssh/config 

我有一个类似的设置。 我定义了一个Checkout作业,其工作是重新提取源代码,明确地在克隆URL中传递一个密码。 一旦完成,子模块更新工作正常。 这是脚本:

 #!/bin/bash git clone --recursive https://myname:$PASSWORD@hub.jazz.net/git/myname/my-project cd my-project git submodule update --remote 

PASSWORD在“环境属性”选项卡上定义为“安全”属性。 这有点笨重和非DRY,但它使我想要的行为。

我使用Checkout工作作为Build作业的input(我可能将其作为一项大工作来完成,但我希望能够在检出和构build时直观地区分故障。)