如何通过 jenkins Copy Artifact Plugin 复制子目录工件

问题描述 投票:0回答:1

我正在尝试使用以下 jenkins 插件将前端应用程序构建工件复制到后续作业。

复制神器插件

应用程序工件输出到以下目录:

/build
  /test
  /js
  /css
  404.html
  index.html

所以我将以下内容放入后续工作的 Jenkinsfile 中:

script {
   try {
     env.FRONT_BRANCH=params.FRONT_BRANCH
     copyArtifacts(projectName: "../front-app/", selector: specific(params.FRONT_BUILD_NO), filter: 'build/**/*', target: 'front', fingerprintArtifacts: false)
   } catch (hudson.AbortException e) {
    println(e)
   }
   sh 'ls front'
}
...

但是,控制台输出在这里:

[Pipeline] sh
+ ls front
build

我期望以下输出结果:

[Pipeline] sh
+ ls front
  test
  js
  css
  404.html
  index.html

我不想复制构建目录,它是工件的根目录。

jenkins jenkins-plugins cicd
1个回答
0
投票

在我自己的一个项目中,我正在使用类似的解决方案,但我使用的是 jenkins 内置 stash/unstash 选项。

藏起来
取消隐藏
stackoverflow文章正确用法

您的问题描述看起来与为您提供的用例 stash 和 unstash 非常相似。

© www.soinside.com 2019 - 2024. All rights reserved.