0
votes

I'm working with Jenkins 2 and trying to copy artifacts between jobs and in turn to an S3 bucket.

I have a simple web build which produces artifacts in /dist/public which I'd like to upload into the S3 bucket.

So once the job completes, I have a folder /dist in the workspace root. Jenkins gives you the ability to copy artifacts between jobs which leverages Ant's fileset.

The issue I'm having is that this is a restricted subset of Ant and all you're provided is include & exclude paths.

I can use dist/public/**/** however this copies the parent directories across also.

What I would prefer is to only copy the content of public/ but after doing some reading it seems this may be difficult to do without a custom Ant tasks, etc.

1

1 Answers

0
votes

If you copy files by Ant, you should set:

<fileset dir="/dist/public"/>

at you copy task, or you can use flatten attribute.

If you use Jenkins artefact collector (as I do), I think now you have to copy this files to workspace root (see: Copy Artifact Plugin).