Search code examples
windowscmdjenkinswdk

How to archive artifacts of parametrized build in Jenkins-ci


I have a Jenkins build project, that builds a Windows driver module for 3-axis configuration (xp, w2k8, w2k3, w7, vista) vs (x86, x64) vs (free, checked).

How can I archive the artifacts including the pdb files intelligently. If I include the files in the jenkins setting I get an error that nothing matching *.pdb was found on free builds.

Better yet, how can I create cmd script that finds all *.sys and *.pdb files in (vbery deep) subdirectories and copies them to a certain directory?


Solution

  • As long as you have at least one other artifact you can write a script to copy it and all other artifacts to a predefined place in your working copy (say, a directory keyed by BUILD_ID, e.g. foo_${BUILD_ID}_bar; you create it dynamically in the script, of course). Then as a post-build step in Jenkins designate everything (${BUILD_ID}/**/*) in that directory as artifacts. It will give you a warning on the configuration page (since the directory does not exist, yet), but will run fine.

    Since every sub-build in the matrix has its own workspace the artifacts won't be mixed. One issue you need to consider is how to clean-up your workspace.