【问题标题】:How to create, and push new Github branches using Jenkins for many repos?如何使用 Jenkins 为许多 repos 创建和推送新的 Github 分支?
【发布时间】:2018-11-12 15:52:36
【问题描述】:

我在 GitHub 上有一个多仓库项目。

我想使用分支系统来切割分支并为所有 repos 创建release/version 分支(最多可达 50 个)

对于 Jenkins 来说,遍历所有这些存储库并创建这些分支的最佳方法是什么?

在每个 repo 上重复使用 Jenkins shell 的最佳方法是什么?

git checkout -b new-branch
git push -u origin new-branch
...repeat for all repos.

How to create new git branch with jenkins shell

但是,对于这种方法,我得到一个“无法读取 'https://github.com' 的用户名:没有这样的设备或地址”,如下所述:Jenkins - could not read Username for 'https://github.com': No such device or address

Jenkins 是否有解决方案或插件可以在一个作业中创建新分支并将其推送到多个不同的存储库?

另外,如果自上次创建发布分支以来有新提交,我可能只想创建一个发布分支。有办法做到这一点吗?

【问题讨论】:

  • 这正是我现在想做的事情。进展如何?
  • 我相信我最终在 Jenkins 中将其实现为单独的作业,因此每个作业都与一个 repo 相关联。

标签: git jenkins github git-branch


【解决方案1】:

我最终解决这个问题的方法是创建多个 Jenkins 作业,每个作业都指向一个 repo。

我无法找到实现上述目标的方法,并设法将多个存储库引用和推送合并到一个作业中。

我创建了一个额外的 Jenkins 作业,它调用了我想要同时运行的所有其他作业。

【讨论】:

    猜你喜欢
    • 2011-12-24
    • 1970-01-01
    • 1970-01-01
    • 2019-09-14
    • 2021-11-23
    • 1970-01-01
    • 2019-08-02
    • 2021-06-11
    • 1970-01-01
    相关资源
    最近更新 更多