Jenkins 存储与 ssh 的集成

Jenkins stash integration with ssh

如果有人能告诉我如何为 Stash 存储库设置 Jenkins,我将不胜感激,不需要 webhooks 或插件(我认为),它用于测试,我只想手动触发构建。 我将存储库 URL ssh://git@stash.xxxxxx:xx/xx/xx.git 与我的存储凭证一起使用,但出现错误 "stderr: Host key verification failed. "

在你的 Jenkins master 上,你需要为 jenkins 用户(或 jenkins 进程的所有者)生成一个 public 密钥:

ssh-keygen -t rsa (with no paraphrase)

接下来,转到 ssh 文件夹 ~/.ssh 并复制 id_rsa.pub 文件的内容。

使用 Stash,继续相关的 project/settings/Access 键。

粘贴您的 public 密钥并选择读取或 read/write 访问权限。

它应该可以解决您的问题:)