From e8d6ff5096acd1066658e819537ba023602bcf0f Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Tue, 1 Jun 2021 19:20:20 +0800 Subject: [PATCH] fix reuse_so_cache (#33234) --- paddle/scripts/paddle_build.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 6d5c7fc670..2eda3d04f8 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -2077,11 +2077,15 @@ function summary_check_problems() { function reuse_so_cache() { get_html="https://api.github.com/repos/PaddlePaddle/Paddle" - merge_commit=grep sha tmp.txt `curl -X GET ${get_html}/commits -H "authorization: token ${GITHUB_API_TOKEN}" >tmp.txt` |awk -F \" 'NR==1{print $(NF-1)}' - merge_pr=grep -oP -m 1 '(#[0-9]*)' tmp.txt `curl -X GET ${get_html}/commits/${merge_commit} -H "authorization: token ${GITHUB_API_TOKEN}" >tmp.txt` |sed 's/#//g' - pr_commit=grep "sha" tmp.txt `curl -X GET ${get_html}/pulls/${merge_pr}/commits -H "authorization: token ${GITHUB_API_TOKEN}"` |tail -3|head -1|awk -F : '{print $NF}'|sed 's#"##g'|sed 's#,##g' + curl -X GET ${get_html}/commits -H "authorization: token ${GITHUB_API_TOKEN}" >tmp.txt + merge_commit=`grep "sha" tmp.txt| awk -F \" 'NR==1{print $(NF-1)}'| sed 's# ##g'` + curl -X GET ${get_html}/commits/${merge_commit} -H "authorization: token ${GITHUB_API_TOKEN}" >tmp.txt + merge_pr=`grep -oP -m 1 '(#[0-9]*)' tmp.txt| sed 's/#//g'` + curl -X GET ${get_html}/pulls/${merge_pr}/commits -H "authorization: token ${GITHUB_API_TOKEN}" >tmp.txt + pr_commit=`grep "sha" tmp.txt |tail -3|head -1|awk -F : '{print $NF}'|sed 's#"##g'|sed 's#,##g'| sed 's# ##g'` set +e - down_proto_so=`wget -q https://xly-devops.bj.bcebos.com/PR/Paddle/${merge_pr}/${pr_commit}/workspace/Paddle/build/proto_so.tar.gz` + wget -q https://xly-devops.bj.bcebos.com/PR/Paddle/${merge_pr}/${pr_commit}/workspace/Paddle/build/proto_so.tar.gz + down_proto_so=`echo $?` set -e if [ "${down_proto_so}" -eq 0 ];then export CI_SKIP_CPP_TEST=ON -- GitLab