如何从管道 (jenkinsfile) 中使用 Jenkins Copy Artifacts 插件? [英] How can I use the Jenkins Copy Artifacts Plugin from within the pipelines (jenkinsfile)?

查看:56
本文介绍了如何从管道 (jenkinsfile) 中使用 Jenkins Copy Artifacts 插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到一个在 Jenkins 管道(工作流)中使用 Jenkins Copy Artifacts 插件的示例.

I am trying to find an example of using the Jenkins Copy Artifacts Plugin from within Jenkins pipelines (workflows).

谁能指出使用它的示例 Groovy 代码?

Can anyone point to a sample Groovy code that is using it?

推荐答案

如果构建不在同一管道中运行,您可以使用直接的 CopyArtifact 插件,示例如下:https://www.cloudbees.com/blog/copying-artifacts-between-builds-jenkins-workflow 和示例代码:

If builds are not running in the same pipeline you can use direct CopyArtifact plugin, here is example: https://www.cloudbees.com/blog/copying-artifacts-between-builds-jenkins-workflow and example code:

node {
   // setup env..
   // copy the deployment unit from another Job...
   step ([$class: 'CopyArtifact',
          projectName: 'webapp_build',
          filter: 'target/orders.war']);
   // deploy 'target/orders.war' to an app host
}

这篇关于如何从管道 (jenkinsfile) 中使用 Jenkins Copy Artifacts 插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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