Skip to content

Commit

Permalink
Merge pull request #682 from zzdhybthu/dev-test
Browse files Browse the repository at this point in the history
Update compile.sh
  • Loading branch information
xiangmy21 authored Mar 31, 2024
2 parents 36c741a + 1cf4150 commit 9dd4087
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dependency/shell/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# WORKDIR /usr/local/PlayerCode/CAPI/cpp
workdir=/usr/local/PlayerCode/CAPI/cpp
bind=/usr/local/code
output=/usr/local/code
output=/usr/local/output

flag=1

Expand All @@ -14,18 +14,18 @@ then
base_name=$(basename "$filename" .cpp)
cd $workdir
cp -f $bind/$filename $workdir/API/src/AI.cpp
cmake ./CMakeLists.txt && make -j$(nproc) >$base_name.txt 2>&1
cmake ./CMakeLists.txt && make -j$(nproc) >$base_name.log 2>&1
mv ./capi $output/$base_name
if [ $? -ne 0 ]; then
flag=0
fi
mv ./$base_name.txt $output/$base_name.txt
mv ./$base_name.log $output/$base_name.log
else
flag=0
fi

if [ $flag -eq 1 ]; then
curl $URL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"compile_status":"Success"}' > $bind/curl_log.txt
curl $URL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"compile_status":"Success"}' > $output/$base_name.curl.log
else
curl $URL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"compile_status":"Failed"}' > $bind/curl_log.txt
curl $URL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"compile_status":"Failed"}' > $output/$base_name.curl.log
fi

0 comments on commit 9dd4087

Please sign in to comment.