如何将工件从slave复制到Jenkins工作区?

时间:2022-04-14 19:59:18

I'm running a jenkins job on a slave and i want to store the generated artifacts in the server.Since the job is currently running on the slave the artifacts are also created there.

我在奴隶上运行jenkins工作,我想将生成的工件存储在服务器中。由于作业当前正在奴隶上运行,因此工件也在那里创建。

I tried using post build actions --->archive the artifacts.But it throws the following build error

我尝试使用post build actions --->归档工件。但是它会抛出以下构建错误

ERROR: No artifacts found that match the file pattern "**/*.gz". Configuration error?

ERROR: '**/*.gz' doesn't match anything: '**' exists but not '**/*.gz'

Any help in this regards is highly appreciated.

对此方面的任何帮助表示高度赞赏。

2 个解决方案

#1


Sounds like Copy To Slave Plugin is what you need

听起来像Copy To Slave Plugin就是你需要的

It can copy to slave (before build) and from slave (after build)

它可以复制到slave(构建之前)和slave(构建之后)

Copy files back to master node: To activate this plugin for a given job, simply check the Copy files back to the job's workspace on the master node checkbox in the Post-build Actions section of the job. You then get the same two fields as for the Copy files to slave node before building section (note that label in the screenshot is old):

将文件复制回主节点:要为给定作业激活此插件,只需在作业的“构建后操作”部分中选中“将文件复制回主节点上作业的工作空间”复选框。然后,您可以在构建部分之前获得与将文件复制到从属节点相同的两个字段(请注意,屏幕截图中的标签是旧的):

#2


if you want to copy artifacts from JobA to the workspace of some other Job, you can do it using the Copy Artifact Plugin which is very simple to understand.

如果要将JobA中的工件复制到其他Job的工作区,可以使用复制工件插件来完成,这很容易理解。

In case you just want to archive the artifacts already in JobA, then you are already in this direction and need to check what you are missing... are you sure that the artifacts are in the current workspace?

如果您只想归档JobA中已有的工件,那么您已经朝着这个方向前进,需要检查您缺少的内容......您确定工件是否在当前工作空间中?

Doron

#1


Sounds like Copy To Slave Plugin is what you need

听起来像Copy To Slave Plugin就是你需要的

It can copy to slave (before build) and from slave (after build)

它可以复制到slave(构建之前)和slave(构建之后)

Copy files back to master node: To activate this plugin for a given job, simply check the Copy files back to the job's workspace on the master node checkbox in the Post-build Actions section of the job. You then get the same two fields as for the Copy files to slave node before building section (note that label in the screenshot is old):

将文件复制回主节点:要为给定作业激活此插件,只需在作业的“构建后操作”部分中选中“将文件复制回主节点上作业的工作空间”复选框。然后,您可以在构建部分之前获得与将文件复制到从属节点相同的两个字段(请注意,屏幕截图中的标签是旧的):

#2


if you want to copy artifacts from JobA to the workspace of some other Job, you can do it using the Copy Artifact Plugin which is very simple to understand.

如果要将JobA中的工件复制到其他Job的工作区,可以使用复制工件插件来完成,这很容易理解。

In case you just want to archive the artifacts already in JobA, then you are already in this direction and need to check what you are missing... are you sure that the artifacts are in the current workspace?

如果您只想归档JobA中已有的工件,那么您已经朝着这个方向前进,需要检查您缺少的内容......您确定工件是否在当前工作空间中?

Doron