1

使用带有蓝色海洋的詹金斯,我配置了一个映射到私人 github 存储库的管道。

如果测试正常,我想将当前分支(比如 master)合并到另一个(比如生产)中,然后调用我自己的工具来部署生产分支的内容。

Blue Ocean 的设置过程已为我配置了对 github 的访问权限(使用 oauth https 令牌)。此外,我为 jenkins 用户设置了一个 ssh 密钥并将其注册到 github。

当我调用 git fetch 时,它失败了,因为它尝试使用 https 获取,所以不要使用我的 ssh 密钥。我如何使用内置的 jekins 身份验证机制来调用git fetch

这是有罪的部分 stage('confirm deployment') { steps { input(message: 'deploy to production?', ok: 'Yes, deploy') } } stage('merge into production branch') { steps { sh '''git fetch git checkout production git merge $BRANCH_NAME git checkout $BRANCH_NAME''' } }

这是相关的输出: + git fetch fatal: could not read Username for 'https://github.com': No such device or address script returned exit code 128

4

0 回答 0