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.


当前回答

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

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

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

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

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

希望能有所帮助。

其他回答

詹金斯2.9

Jenkins >新项目 输入项目名称-例如。“MY_CLONE” 指定源(Copy from)作业> OK 当您开始键入名称时,将会找到现有的值。注意,这是区分大小写的。 如果希望保留默认值,则单击Save。 现在这两个工作都在同一个地方:

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

如果你想复制相同的Jenkins,但在不同的子文件夹,创建新项目->使用copy from。新Job将被克隆到同一目录。然后使用移动选项移动到所需的目录

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

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

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

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

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