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.


当前回答

在我的例子中,我必须将一个作业从一个jenkins实例复制到另一个实例。

因此,首先我查看了旧Jenkins的目录结构(作业/目录名;还注意到config.xml),然后在新jenkins的目录结构下,在那里我创建了一个同名/job的目录,并复制了这个新创建的目录下的config.xml。

然后在“管理Jenkins”下,我点击“从磁盘重新加载配置”。这是它。

其他回答

你可以克隆一个工作:

点击“新项目”链接 给你的工作起个新名字 选择单选按钮“复制现有项目” 给出要克隆的作业名称 单击“OK”

最后,您有了新的工作,它反映了克隆工作的所有特征。

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

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

要复制现有作业,请访问http://your-jenkins/newJob并使用“复制现有作业”选项。输入现有作业的名称——Jenkins将验证它是否存在。

Jenkins首页上的默认选项卡应该列出所有现有的工作,但可能是您的前任删除了该选项卡。您可以创建一个新选项卡,列出http://your-jenkins/newView中的所有作业。

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

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