Jenkins has the Gerrit Plugin in place so that when we do check-ins to Gerrit, Jenkins performs a build and if it succeeds, then the modification in Gerrit is verified. If the build fails then it is not. My understanding is that this is accomplished through jobs set up in Jenkins. We have now created a new branch (git) and I guess I need to clone the existing jobs pointing to the other branch so that this same workflow occurs and builds are performed on every commit. Can somebody explain how I would clone these jobs? I don't seem to see a way to do it through the UI nor can I even see a way to list the jobs out through the UI.
当前回答
这里所有的答案都非常有用,但忽略了詹金斯一个非常奇怪的bug。在编辑了新的作业配置后,有时如果缩放级别太高,可能看不到保存或应用按钮选项。该按钮出现在页面上,并被您的缩放级别隐藏,您必须缩小,直到您在页面的左下角看到该按钮。
奇怪,我知道!
其他回答
如果你想复制相同的Jenkins,但在不同的子文件夹,创建新项目->使用copy from。新Job将被克隆到同一目录。然后使用移动选项移动到所需的目录
你也可以使用Copy项目链接插件。
这将在项目的左侧面板上添加一个链接:
下面的屏幕将要求输入新的Job名称:
创建一个新的项目,去到最后你会发现选项复制从现有的,只是写你当前的工作名称,你将有克隆的项目工作。
在我的例子中,我必须将一个作业从一个jenkins实例复制到另一个实例。
因此,首先我查看了旧Jenkins的目录结构(作业/目录名;还注意到config.xml),然后在新jenkins的目录结构下,在那里我创建了一个同名/job的目录,并复制了这个新创建的目录下的config.xml。
然后在“管理Jenkins”下,我点击“从磁盘重新加载配置”。这是它。
你可以使用Jobcopy Builder插件
推荐文章
- “git restore”命令是什么?“git restore”和“git reset”之间有什么区别?
- Git合并与强制覆盖
- Git拉另一个分支
- 在Bash命令提示符上添加git分支
- 如何更改Git日志日期格式
- 如何使用GitHub Org Plugin从jenkins管道(jenkinsfile)触发另一个作业?
- git pull -rebase和git pull -ff-only之间的区别
- GitHub -致命:无法读取用户名https://github.com':没有这样的文件或目录
- 撤消git平分错误
- 使用.gitconfig配置diff工具
- 如何配置Mac OS X术语,使git有颜色?
- Visual Studio Code: .git文件夹/文件隐藏
- “node_modules”文件夹应该包含在git存储库中吗
- 为什么git-rebase给了我合并冲突,而我所做的只是压缩提交?
- 当我试图推到原点时,为什么Git告诉我“没有这样的远程‘原点’”?