0

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.

kenorb
  • 155,785
  • 88
  • 678
  • 743
timothyclifford
  • 6,799
  • 7
  • 57
  • 85

1 Answers1

0

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).

kenorb
  • 155,785
  • 88
  • 678
  • 743
whitediver
  • 462
  • 3
  • 12