Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Authentication 有没有办法在bitbucket-pipelines.xml中指定.pem密钥?_Authentication_Bitbucket_Continuous Deployment_Remote Server_Bitbucket Pipelines - Fatal编程技术网

Authentication 有没有办法在bitbucket-pipelines.xml中指定.pem密钥?

Authentication 有没有办法在bitbucket-pipelines.xml中指定.pem密钥?,authentication,bitbucket,continuous-deployment,remote-server,bitbucket-pipelines,Authentication,Bitbucket,Continuous Deployment,Remote Server,Bitbucket Pipelines,我正在尝试通过bitbucket管道从bitbucket部署构建。 基本上,我需要的是将静态构建文件复制到远程服务器。 此服务器需要一个.pem文件进行身份验证。 我已尝试通过以下方式指定此密钥: 作为存储库变量 作为存储库本身中的文件,并在构建XML中指向它 作为scp部署的参数 但在所有情况下,都会出现相同的问题: 主机密钥验证失败。断开连接错误命令失败 出口代码为1 因此,如果有人能告诉我如何在bitbucket-pipelines.xml文件中指定这一点以实现平滑构建,那将是一个很大的帮

我正在尝试通过bitbucket管道从bitbucket部署构建。 基本上,我需要的是将静态构建文件复制到远程服务器。 此服务器需要一个.pem文件进行身份验证。 我已尝试通过以下方式指定此密钥:

  • 作为存储库变量
  • 作为存储库本身中的文件,并在构建XML中指向它
  • 作为scp部署的参数
  • 但在所有情况下,都会出现相同的问题:

    主机密钥验证失败。断开连接错误命令失败 出口代码为1


    因此,如果有人能告诉我如何在bitbucket-pipelines.xml文件中指定这一点以实现平滑构建,那将是一个很大的帮助。

    管道在docker容器中运行。可能有两种方法-

    • 您可以在secret repo var中添加.pem文件内容,将内容写入文件并将其命名为something.pem,用生成的文件位置替换配置xml文件; 秘密回购var看起来像:Name-MY_PEM值-一些加密内容 在您的管道中: 要在本地写入文件,请执行以下操作: echo$MY_PEM>MY.PEM 替换配置XML中的fiel路径 sed-i“s/{XML中的占位符}/${MY_PEM_PATH}/g”PATH/to/Your/config.XML
    • 将.pem文件捆绑到docker容器中,并将容器部署到私有容器注册表中(例如Google Cloud、AWS等)。将该容器用作基础图像