我如何从管道内使用Jenkins Copy Artifacts插件(jenkinsfile)? [英] How can I use the Jenkins Copy Artifacts Plugin from within the pipelines (jenkinsfile)?
本文介绍了我如何从管道内使用Jenkins Copy Artifacts插件(jenkinsfile)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以指向一个示例Groovy代码,它是一个示例代码,它是一个示例代码,可以使用Jenkins复制工件插件从Jenkins管道(工作流)使用它?
解决方案
如果构建不在同一管道中运行,则可以使用直接 CopyArtifact
插件,这里是例子: https://www.cloudbees.com / blog / copying-artifacts-between-builds-jenkins-workflow 和示例代码:
node {
// setup env ..
//从另一个Job复制部署单元...
step([$ class:'CopyArtifact',
projectName:'webapp_build',
filter:'target / orders.war']);
//将'target / orders.war'部署到应用主机
}
I am trying to find an example of using the Jenkins Copy Artifacts Plugin from within Jenkins pipelines (workflows).
Can anyone point to a sample Groovy code that is using it?
解决方案
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
}
这篇关于我如何从管道内使用Jenkins Copy Artifacts插件(jenkinsfile)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文