Jenkins-从在不同节点中构建的上游作业复制工件 [英] Jenkins - Copy Artifacts from upstream job built in different node

查看:359
本文介绍了Jenkins-从在不同节点中构建的上游作业复制工件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个由开发团队控制的工作,该工作建立在另一个节点中.我在测试团队中,他们希望使用工件并在测试设备上进行部署.

There is a job controlled by Development team which built in a different node. I am on Testing team who want to take the artifacts and deploy on test device.

我可以看到来自dev的那些工件被存储在dev节点中的某个路径中.这是否意味着必须先将其归档在Jenkins master中,然后才能将其复制到我的工作中? 我正在使用Artifact插件并不断收到错误

I can see those Artifacts from dev are stored in some path in dev's node. Does it means it must first archived in Jenkins master before I can copy it to my job? I am using Copy Artifact plugin and constantly getting the error

Failed to copy artifacts from <dev-job> with filter: <path-in-dev-node>

*自从我刚从TeamCity搬出以来,出现了一些新手问题

*Some newbie question since i just moved from TeamCity

推荐答案

您可能要使用:复制Artifact插件.

添加了一个构建步骤来复制另一个项目中的工件.

Adds a build step to copy artifacts from another project.

还要考虑一下,詹金斯(Jenkins)后置步骤存档文物".

Consider also, the Jenkins post-buid step "Archive the artifacts".

如果从另一个作业的工作空间进行复制,那么如果正在进行另一个作业或擦除了工作空间,会发生什么情况?该步骤将它们从节点复制到主节点,并将副本与构建日志等一起存储.只要保留构建日志,就可以通过UI使用它们.它会占用空间.

If you copy from the other job's workspace, what happens if another job is in progress or the workspace is wiped? That step copies them from the node to the master and stores a copy along with the build logs, etc. That makes them available via the UI as long as the build logs remain. It can take up space tho.

如果您确实使用了归档工件,请考虑使用系统属性 jenkins.model.Jenkins.buildsDir 将所有构建日志(和工件)存储在Jobs config目录之外.将两者分开(配置/日志)需要一些停机时间和工作.

If you do use archive artifacts, consider using the system property jenkins.model.Jenkins.buildsDir to store all the build logs (and artifacts) outside of the jobs config directory. Some downtime and work required to separate the two (config / logs) .

您可能还需要考虑使用适当的存储库管理器( Nexus /人工工厂)

You may also want to consider using a proper repository manager (Nexus / artifactory)

最后,您可能想了解有关使用 Jenkins管道的知识,而不是依赖于链式作业,触发器或用户等. 为什么? '因为它更易于控制,更易于维护.

Finally, you may want to learn about using a Jenkins pipeline rather the relying on chained jobs, triggers or users and so forth. Why? 'cos it's much more controlled and easier to maintain.

ps:我不是 artifactDeployer 的忠实拥护者,但它可能对您有用.

ps: I'm not a huge fan of artifactDeployer, but it may work for you.

pps:您可能需要深入了解以下答案: Jenkis的下游作业无法找到上游工件

pps: you may want to review this in depth answer: Jenkis downstream job fails to find upstream artifacts

这篇关于Jenkins-从在不同节点中构建的上游作业复制工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆