[英]Access environment variables stored in Google Secret Manager from Bitbucket pipelines
I am using bitbucket pipeline to run test cases.我正在使用 bitbucket 管道来运行测试用例。 In order for test cases to succeed, I need secrets which is stored in google secret manager.
为了使测试用例成功,我需要存储在谷歌秘密管理器中的秘密。 Is there any way I can access those secrets within bitbucket pipeline environment?
有什么办法可以在 bitbucket 管道环境中访问这些秘密吗?
There are a couple of options.有几个选项。
In case if these secrets are static, the easiest solution would be adding them to your Repository or Deployment variables .如果这些秘密是 static,最简单的解决方案是将它们添加到您的存储库或部署变量中。 Make sure that they're marked as Secured, so that they will be masked, ie hidden, in the logs.
确保它们被标记为安全,这样它们将被屏蔽,即隐藏在日志中。
Alternatively, if your secrets are rotated and must be fetched from the secrets manager on every build in order to stay up-to-date, you'll need to use corresponding CLI commands in the build script.或者,如果您的机密被轮换并且必须在每次构建时从机密管理器中获取以保持最新状态,您将需要在构建脚本中使用相应的CLI 命令。 In order for this to work you will have to give Bitbucket Pipelines access to the secrets in your cloud.
为了让它工作,你必须给 Bitbucket 管道访问你云中的秘密。 For details, check out, for example, this page .
有关详细信息,请查看此页面等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.