Log files over 200 MB into archived file 51/55751/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 20 Apr 2017 16:50:39 +0000 (12:50 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 20 Apr 2017 17:08:35 +0000 (13:08 -0400)
We need to determine sizes of large files going into Nexus since there
is a 500 MB limit. Let's log all files larger than 200 MB into a file so
we can track them.

Change-Id: Ia38e81544f857785364b3c19a575dbd0aaa1735e
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/autorelease/include-raw-autorelease-maven-deploy.sh

index 164349923d50221307ce44e53b760c2a3bd13fd9..8479b95a203cc3083897b30c69b173b0d4bef2a7 100644 (file)
@@ -36,3 +36,13 @@ rsync -avz --remove-source-files \
     -DserverId="$NEXUS_STAGING_SERVER_ID" \
     -s "$SETTINGS_FILE" \
     -gs "$GLOBAL_SETTINGS_FILE" | tee "$WORKSPACE/deploy-staged-repository.log"
+
+# Log all files larger than 200 MB into large-files.log
+while IFS= read -r -d '' file
+do
+    FILE_SIZE=$(du --summarize --block-size 1 "$file" | awk '{print $1}')
+    # Check if file size is larger than 200 MB
+    if [[ $FILE_SIZE -gt 209715200 ]]; then
+        echo "$FILE_SIZE $file" >> "$WORKSPACE/large-files.log"
+    fi
+done <   <(find "$(pwd)/m2repo" -type f -print0)