我想要自动化我们的发布过程,并且我有一个 Maven 项目的以下 Jenkins 构建作业:
如果我运行构建,我在执行Post Step Shell 脚本期间会收到以下错误:
fatal: could not read Username for 'https://mygitserver': Input/output error
Run Code Online (Sandbox Code Playgroud)
Git Repo 服务器使用 HTTP 进行身份验证。
在控制台日志中,我可以看到 Jenkins 使用 .gitcredentials 来处理身份验证:
using .gitcredentials to set credentials
> git config --local credential.username jenkins # timeout=10
> git config --local credential.helper store --file=/tmp/git2442727044778485.credentials # timeout=10
Run Code Online (Sandbox Code Playgroud)
我现在想实际上重用这些凭证存储,因为它们是在构建开始时创建的,但在克隆后再次删除。
这是否可能,或者我是否需要自己使用“凭据绑定插件”等以某种方式处理这个问题?