Harness CI : How to publish all the artifacts including subfolders & files

Problem Statement

We would like to publish all artifacts including files and subfolder but we are able to publish only files to the Artifactory from the source location.

Before we jump to the solution

You can use standard glob expressions to upload multiple files. For example, src/js/**/*.js will upload all Javascript files in src/js/subfolder-1/, src/js/subfolder-2, and so on

But the above approach uploads all subfolder files at same level. To upload publish artifacts with its subfolders & files. As an example, to upload folder including recursive subfolders with its file to the artifactory we need to change our approach gloabal expression doesn’t help here.

Solution to upload folder with recurssive subfolders with it’s file

Harness artifactory OOTB step only supports flat hierarchy while uploading. We recommend using a plugin (plugins/artifactory:1.2.0) step which supports flat=false (use same hierarchy as source)

That’s all for this Article

Happy building, deploying and much more with Harness

1 Like