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。在编辑了新的作业配置后,有时如果缩放级别太高,可能看不到保存或应用按钮选项。该按钮出现在页面上,并被您的缩放级别隐藏,您必须缩小,直到您在页面的左下角看到该按钮。

奇怪,我知道!

其他回答

新建项目>项目名称= abc >选择“从已有作业的作业名称复制”,而不是“Freestyle作业”

如果你在你想要复制的文件夹中,那么使用../。

你也可以使用Copy项目链接插件。

这将在项目的左侧面板上添加一个链接:

下面的屏幕将要求输入新的Job名称:

我无法从子文件夹复制詹金斯作业。从选项复制没有显示我正在寻找的建议。不使用建议,复制作业名是行不通的。

因此,如果您想从外部文件夹创建一个作业,您需要首先在子文件夹中创建作业,然后将其移动到需要放置它的不同文件夹中。

以上答案都是好的。但如果您为作业创建了“文件夹”,情况就略有不同了。

单击要在其中创建新作业的文件夹。然后点击左侧菜单中的“新建项目”。现在你的“新工作”URL看起来像这样(假设你在“my-folder”下创建了新工作):

http://my-jenkins:8080/job/my-folder/newJob

在“输入项目名称”下,输入所需的新作业名称。 然后使用底部的“从文本框复制”。输入源作业的作业路径。

例如,如果你的源作业在src-folder文件夹下,并且作业的名称是src-job,你必须在“从”框中输入src-folder/src-job。

希望能有所帮助。

创建一个新的项目,去到最后你会发现选项复制从现有的,只是写你当前的工作名称,你将有克隆的项目工作。