2023-05-09 17:38:19 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -x -e
|
|
|
|
|
|
|
|
|
|
|
|
STATIC_DATA=${STATIC_DATA:-/woboq_codebrowser/data}
|
2023-05-09 20:01:09 +00:00
|
|
|
SOURCE_DIRECTORY=${SOURCE_DIRECTORY:-/build}
|
|
|
|
BUILD_DIRECTORY=${BUILD_DIRECTORY:-/workdir/build}
|
2023-05-10 11:02:21 +00:00
|
|
|
OUTPUT_DIRECTORY=${OUTPUT_DIRECTORY:-/workdir/output}
|
|
|
|
HTML_RESULT_DIRECTORY=${HTML_RESULT_DIRECTORY:-$OUTPUT_DIRECTORY/html_report}
|
2023-05-09 17:38:19 +00:00
|
|
|
SHA=${SHA:-nosha}
|
|
|
|
DATA=${DATA:-https://s3.amazonaws.com/clickhouse-test-reports/codebrowser/data}
|
2023-05-10 20:23:27 +00:00
|
|
|
nproc=$(($(nproc) + 2)) # increase parallelism
|
2023-05-09 17:38:19 +00:00
|
|
|
|
2023-05-09 20:01:09 +00:00
|
|
|
read -ra CMAKE_FLAGS <<< "${CMAKE_FLAGS:-}"
|
|
|
|
|
2023-05-09 17:38:19 +00:00
|
|
|
mkdir -p "$BUILD_DIRECTORY" && cd "$BUILD_DIRECTORY"
|
2023-05-18 16:18:30 +00:00
|
|
|
cmake "$SOURCE_DIRECTORY" -DCMAKE_CXX_COMPILER="/usr/bin/clang++-${LLVM_VERSION}" -DCMAKE_C_COMPILER="/usr/bin/clang-${LLVM_VERSION}" -DENABLE_WOBOQ_CODEBROWSER=ON "${CMAKE_FLAGS[@]}"
|
2023-05-09 17:38:19 +00:00
|
|
|
mkdir -p "$HTML_RESULT_DIRECTORY"
|
2023-05-10 11:02:21 +00:00
|
|
|
echo 'Filter out too noisy "Error: filename" lines and keep them in full codebrowser_generator.log'
|
2023-05-09 17:38:19 +00:00
|
|
|
/woboq_codebrowser/generator/codebrowser_generator -b "$BUILD_DIRECTORY" -a \
|
2023-05-10 20:23:27 +00:00
|
|
|
-o "$HTML_RESULT_DIRECTORY" --execute-concurrency="$nproc" -p "ClickHouse:$SOURCE_DIRECTORY:$SHA" \
|
2023-05-10 11:02:21 +00:00
|
|
|
-d "$DATA" \
|
|
|
|
|& ts '%Y-%m-%d %H:%M:%S' \
|
|
|
|
| tee "$OUTPUT_DIRECTORY/codebrowser_generator.log" \
|
|
|
|
| grep --line-buffered -v ':[0-9]* Error: '
|
2023-05-09 17:38:19 +00:00
|
|
|
cp -r "$STATIC_DATA" "$HTML_RESULT_DIRECTORY/"
|
|
|
|
/woboq_codebrowser/indexgenerator/codebrowser_indexgenerator "$HTML_RESULT_DIRECTORY" \
|
2023-05-09 20:01:09 +00:00
|
|
|
-d "$DATA" |& ts '%Y-%m-%d %H:%M:%S'
|