Jenkins CI Post-build Actions - 如何推送到 Stash

Jenkins CI Post-build Actions - How to push to Stash

我已将 Jenkins 设置为监视私有 GitHub 存储库,并且当前正在执行构建,当我使用 GitHub 挂钩提交给 GitHub 时。是否可以设置一个操作,然后使用 'Post-build Actions'?

将相同的代码推送到 Stash 存储库

所以澄清一下,我让 Jenkins 检测到推送到 GitHub 的新代码,我想在构建后启动一个额外的操作,使用 Jenkins 将相同的代码推送到 Stash回购

有什么想法吗?

Post-build "Git Publisher" 步骤会将当前 HEAD 推送到 "Git Repositories".

中指定的 git 存储库上的指定远程

要配置:将您的私有存储库和隐藏存储库添加到 Git 存储库,将 "branch to build" 指定到您的私有存储库的目标分支。 创建一个 Git Publisher post-build 操作,告诉它推送到 Stash 存储库上所需的分支。

如果这不起作用,您可以随时返回 "execute shell" 构建步骤并在脚本中指定 git 命令,但这并不理想。