echo "Build logs: <a href=\"$LOGS_SERVER/$SILO/$ARCHIVES_DIR\">$LOGS_SERVER/$SILO/$ARCHIVES_DIR</a>"
mkdir .archives
-cd .archives/ || exit 404
+cd .archives/ || exit 1
cat > deploy-archives.xml <<EOF
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
shopt -s globstar # Enable globstar to copy archives
for f in $ARCHIVE_ARTIFACTS; do
[[ -e $f ]] || continue # handle the case of no files to archive
- echo "Archiving $f"
+ echo "Archiving $f" >> "$WORKSPACE/.archives/$ARCHIVES_DIR/_archives.log"
dir=$(dirname "$f")
mkdir -p "$WORKSPACE/archives/$dir"
mv "$f" "$WORKSPACE/archives/$f"
# Ignore logging if archives doesn't exist
mv "$WORKSPACE/archives/" "$ARCHIVES_DIR" > /dev/null 2>&1
touch "$ARCHIVES_DIR/_build-details.txt"
-echo "build-url: ${{BUILD_URL}}" >> "$ARCHIVES_DIR/_build-details.txt"
-env | grep -v PASSWORD > "$ARCHIVES_DIR/_build-enviroment-variables.txt"
+echo "build-url: ${BUILD_URL}" >> "$ARCHIVES_DIR/_build-details.txt"
+env | grep -v PASSWORD | sort > "$ARCHIVES_DIR/_build-enviroment-variables.txt"
# capture system info
touch "$ARCHIVES_DIR/_sys-info.txt"
| egrep -e ':.*text.*' \
| cut -d: -f1 \
| xargs -d'\n' -r gzip
+# Compress Java heap dumps using xz
+find "$ARCHIVES_DIR" -type f -name \*.hprof -print0 | xargs -0 xz -T 0
-zip -r archives.zip "$JENKINS_HOSTNAME/" > "$ARCHIVES_DIR/_archives-zip.log"
+zip -r archives.zip "$JENKINS_HOSTNAME/" >> "$ARCHIVES_DIR/_archives.log"
du -sh archives.zip