@@ -5,6 +5,7 @@ source tools/circleci-helpers.sh
5
5
set -euo pipefail
6
6
IFS=$' \n\t '
7
7
8
+ # Relative directory name
8
9
CT_REPORTS=$( ct_reports_dir)
9
10
mkdir -p ${CT_REPORTS} /small
10
11
mkdir -p ${CT_REPORTS} /big
@@ -29,14 +30,35 @@ cat > ${CT_REPORTS}/index.html << EOL
29
30
</html>
30
31
EOL
31
32
33
+ CT_REPORTS_FULL=$( cd " $CT_REPORTS " && pwd)
34
+
32
35
now=` date +' %Y-%m-%d_%H.%M.%S' `
33
- LOG_DIR_ROOT=${CT_REPORTS} /logs/${now}
36
+ # Replace all occurrences of / with _
37
+ PREFIX=" ${CT_REPORTS// \/ / _} "
38
+
39
+ # Optimize naming, so it is easy to extract on MacOS just by clicking it
40
+ # and with reasonable directory names
41
+ LOG_DIR_ROOT=${CT_REPORTS} /logs/${PREFIX} _${now}
42
+ LOG_ZIP=${CT_REPORTS_FULL} /logs_${PREFIX} _${now} .tar.gz
34
43
for dev_node_logs_path in ` find _build -name log -type d` ; do
35
44
dev_node=$( basename $( dirname $( dirname $( dirname ${dev_node_logs_path} ) ) ) )
36
- LOG_DIR=${LOG_DIR_ROOT} /${dev_node} /log
45
+ LOG_DIR=${LOG_DIR_ROOT} /${dev_node} /
37
46
mkdir -p ${LOG_DIR}
38
47
cp ${dev_node_logs_path} /* ${LOG_DIR}
39
48
done
40
49
41
50
cp * .log ${LOG_DIR_ROOT}
42
51
cp big_tests/* .log ${LOG_DIR_ROOT} || true
52
+
53
+ OLD_DIR=$( pwd)
54
+
55
+ # cd so we don't include nested dirs in the archive (for example, PR/4366/236412)
56
+ cd " $LOG_DIR_ROOT /.."
57
+
58
+ # Zip to safe space
59
+ tar -czvf " $LOG_ZIP " " $( basename " $LOG_DIR_ROOT " ) "
60
+
61
+ cd " $OLD_DIR "
62
+
63
+ # Slightly faster than removing
64
+ mv " $LOG_DIR_ROOT " /tmp/
0 commit comments