在CI环境中为Maven项目保留GPG密钥的位置? [英] Where to keep a GPG secret key for a Maven project in CI environment?

查看:312
本文介绍了在CI环境中为Maven项目保留GPG密钥的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 maven-gpg-plugin:sign 以便在部署到Sonatype OSS存储库之前签署项目工件。问题是我在哪里保存我的秘密密钥 secring.gpg

I'm trying to use maven-gpg-plugin:sign in order to sign project artifacts before deployment to Sonatype OSS repository. The question is where shall I keep my secret key secring.gpg:


  1. 持续集成〜/ .gnupg 目录

  2. 在项目源代码中,例如 src / test / resources / gpg / secring.gpg

  1. In continuous integration ~/.gnupg directory
  2. In project source code, e.g. src/test/resources/gpg/secring.gpg

为什么?

推荐答案

如果密钥敏感,请将其放在CI服务器的〜/ .gnupg目录中,并使用适当的访问修饰符保护该目录。
第二种方法将允许每个有权访问项目的开发人员查看密钥。

If key is sensitive put it in ~/.gnupg directory on CI server and protect that directory with proper access modifiers. 2nd approach will allow every developer with access to project to see key.

这篇关于在CI环境中为Maven项目保留GPG密钥的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆