Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy Artifact Plugin - Copy from WORKSPACE without the path from Artifacts to copy

I would like to copy Jenkins WORKSPACE items from a job to another using Copy Artifact Plugin as follows:

  • from Job A's WORKSPACE: /output/bundle/<all files and folders>
  • to Job B under ${AUT} path which is: c:/AUT

Plugin setup

  • Project name: project-build
  • Which build: Copy from WORKSPACE of latest completed build
  • Artifacts to copy: output/bundle/**
  • Target directory: ${AUT}

The copy is performed but the content of the Target Directory will be: c:/AUT/output/bundle/<all files and folders>

How can I modify the Artifacts to copy or Target directory in order to have the following result: c:/AUT/<all files and folders>?

Just to be more clear, I would like to copy only the content of /output/bundle/<all files and folders> not having the /output/bundle/ path in the Target directory.

like image 368
LeeWay Avatar asked Sep 26 '16 05:09

LeeWay


1 Answers

There should be a "flatten directory" option in the advanced setting, which will expand whatever you have in the source directory to the target directory. However, this will also expand the folder in the source directory, to solve that you need to be more specific on the source folder and the destination folder. For example, src: output/bundle/a/**, dst: ${AUT}/a/

like image 197
lomo44 Avatar answered Oct 24 '22 08:10

lomo44