From 05ccdb016681f39fc4ff0c4d89cef81e180c18cf Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 1 Jun 2020 15:33:56 +0800 Subject: [PATCH] determine if TDengine need pull and recompile [TD-495] --- tests/perftest-scripts/perftest-daily.sh | 28 ++++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/tests/perftest-scripts/perftest-daily.sh b/tests/perftest-scripts/perftest-daily.sh index 894d9c7905..9d51438f63 100755 --- a/tests/perftest-scripts/perftest-daily.sh +++ b/tests/perftest-scripts/perftest-daily.sh @@ -31,12 +31,26 @@ function collectSysInfo { function buildTDengine { cd /root/TDengine - git pull - cd debug - rm -rf * - cmake .. - make > /dev/null - make install + + git remote update + REMOTE_COMMIT=`git rev-parse --short remotes/origin/develop` + LOCAL_COMMIT=`git rev-parse --short @` + + echo " LOCAL: $LOCAL_COMMIT" + echo "REMOTE: $REMOTE_COMMIT" + if [ "$LOCAL_COMMIT" == "$REMOTE_COMMIT" ]; then + echo "repo up-to-date" + else + echo "repo need to pull" + git pull + + LOCAL_COMMIT=`git rev-parse @` + cd debug + rm -rf * + cmake .. + make > /dev/null + make install + fi } function restartTaosd { @@ -55,7 +69,7 @@ function sendReport { receiver="sdsang@taosdata.com, sangshuduo@gmail.com" mimebody="MIME-Version: 1.0\nContent-Type: text/html; charset=utf-8\n" - echo -e "to: ${receiver}\nsubject: Perf test report ${today}\n" | \ + echo -e "to: ${receiver}\nsubject: Perf test report ${today}, commit ID: ${LOCAL_COMMIT}\n" | \ (cat - && uuencode perftest-1d-$today.log perftest-1d-$today.log)| \ (cat - && uuencode perftest-1d-report.csv perftest-1d-report-$today.csv) | \ (cat - && uuencode perftest-1d-report.png perftest-1d-report-$today.png) | \ -- GitLab