Allows us to use **/*.xml for example as the archive parameter.
Change-Id: I5a92e198999a3db31fedc23e65f4c5315561f93c
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
EOF
mkdir -p $ARCHIVES_DIR
+mkdir -p $WORKSPACE/archives
+if [ ! -z $ARCHIVE_ARTIFACTS ]; then
+ pushd $WORKSPACE
+ shopt -s globstar # Enable globstar to copy archives
+ archive_artifacts=$(echo $ARCHIVE_ARTIFACTS)
+ for f in $archive_artifacts; do
+ echo "Archiving $f"
+ mkdir -p $WORKSPACE/archives/$(dirname $f)
+ mv $f $WORKSPACE/archives/$f
+ done
+ shopt -u globstar # Disable globstar once archives are copied
+ popd
+fi
# Ignore logging if archives doesn't exist
mv $WORKSPACE/archives/ $ARCHIVES_DIR > /dev/null 2>&1
touch $ARCHIVES_DIR/_build-details.txt
# To archive things the job will need to create a "archives" directory in
# the workspace and this macro will handle copying the contents of the
# archives directory.
+ #
+ # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files
+ # to archive. You can pass globstar patterns for example "**/*.xml **/*.log"
+ # as the archive pattern. This is a space separated list of files to archive.
+ #
# Also ensure that the workspace is cleaned up at the end of the build.
publishers:
- postbuildscript: