[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser-bundle-testsuite/master] Bug 40021: Archive old nightly builds on tb-build-01



commit e7fcf4a4722c88f52069bf2dea6c7feaceba173c
Author: Nicolas Vigier <boklm@xxxxxxxxxxxxxx>
Date:   Tue Mar 23 17:18:07 2021 +0100

    Bug 40021: Archive old nightly builds on tb-build-01
---
 tools/tb-build-01-start-nightly-build | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/tools/tb-build-01-start-nightly-build b/tools/tb-build-01-start-nightly-build
index 6a37459..1d693e0 100755
--- a/tools/tb-build-01-start-nightly-build
+++ b/tools/tb-build-01-start-nightly-build
@@ -1,10 +1,41 @@
 #!/bin/bash
 set -e
 
+today_version=$(date '+tbb-nightly.%Y.%m.%d')
+
 cd /home/tb-builder/tor-browser-bundle-testsuite
 export RBM_NO_DEBUG=1
 ./tbb-testsuite --config=tb-build-01.torproject.org "$@"
-/home/tb-builder/tor-browser-bundle-testsuite/clones/tor-browser-build/tools/prune-old-builds --days 1 --weeks 0 --months 0 ~/nightly-builds/tor-browser-builds
+
+# Archive today's build
+archive_dir=~/tor-browser-builds-archive/"$today_version"
+if ! test -d "$archive_dir"
+then
+  mkdir -p "$archive_dir"
+  for dir in ~/nightly-builds/tor-browser-builds/"$today_version"/*
+  do
+    test -d "$dir" || continue
+    dname=$archive_dir/$(basename "$dir")
+    mkdir -p "$dname"
+    test -d "$dir/logs" && cp -a "$dir/logs" "$dname"
+    find "$dir" -maxdepth 1 \( \
+                   -name '*.txt' \
+                -o -name '*.asc' \
+                -o -name 'torbrowser-install-*_en-US.exe' \
+                -o -name 'TorBrowser-*_en-US.dmg' \
+                -o -name 'tor-browser-linux*_en-US.tar.xz' \
+                -o -name '*-multi-qa.apk' \
+                \) \
+      -a -execdir cp -a {} "$dname" \;
+  done
+  /home/tb-builder/tor-browser-bundle-testsuite/clones/tor-browser-build/tools/prune-old-builds --days 100 --weeks 30 --months 12 ~/tor-browser-builds-archive
+fi
+
+# Only clean previous builds if we use more than 20GB
+builds_size=$(du -s ~/nightly-builds/tor-browser-builds | cut -f 1)
+test "$builds_size" -gt 20000000 && \
+  /home/tb-builder/tor-browser-bundle-testsuite/clones/tor-browser-build/tools/prune-old-builds --days 1 --weeks 0 --months 0 ~/nightly-builds/tor-browser-builds
+
 # sleep for 5m to give time to previous rsync to finish
 sleep 5m
 /home/tb-builder/tor-browser-bundle-testsuite/tools/rsync-to-tbb-nightlies-master

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits