From 604904cbf8b2df8377561413092bbc325d8cc3b9 Mon Sep 17 00:00:00 2001 From: idea4good Date: Mon, 28 Dec 2020 15:34:45 +0800 Subject: [PATCH] update workspace --- workspace/.sync.sh | 17 ++++++++++------- workspace/sync_build.bat | 27 +++++++++++++++++---------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/workspace/.sync.sh b/workspace/.sync.sh index 7c86b83..7623bb9 100755 --- a/workspace/.sync.sh +++ b/workspace/.sync.sh @@ -7,13 +7,6 @@ url="https://api.powerbi.com/beta/72f988bf-86f1-41af-91ab-2d7cd011db47/datasets/ build_time=`date +%Y-%m-%dT%H:%M:%S.000%z` device_info=`uname -s -n -m` -curl --include --request POST --header "Content-Type: application/json" --data-binary "[{ -\"device_info\" :\"$device_info\", -\"project_info\" :\"$1\", -\"time\" :\"$build_time\", -\"weight\" :1 -}]" $url > /dev/null - #--------------- Geo info ----------------# curl ipinfo.io > ip_info.txt # get IP info @@ -32,6 +25,16 @@ sed -i 's/"org"://g' ip_org.txt #remove property name sed -i 's/"//g' ip_org.txt #remove double quotes org=`sed 's/,//g' ip_org.txt` #remove comma +curl --include --request POST --header "Content-Type: application/json" --data-binary "[{ +\"device_info\" :\"$device_info\", +\"project_info\" :\"$1\", +\"time\" :\"$build_time\", +\"weight\" :1, +\"country\" :\"$country\", +\"city\" :\"$city\", +\"org\" :\"$org\" +}]" $url > /dev/null + url="https://api.powerbi.com/beta/72f988bf-86f1-41af-91ab-2d7cd011db47/datasets/d6c4145f-2fdc-4071-94f7-fbdb090914d4/rows?key=pQ7GFsXkAqJij4v%2BadZDoth6HB%2BmjZbAn0d%2B%2BtlWnE3jpm1s0lGKoFeFV7aF1QQ7PKOYGpQYYCkS0tjzxTgbLQ%3D%3D" curl --include --request POST --header "Content-Type: application/json" --data-binary "[{ diff --git a/workspace/sync_build.bat b/workspace/sync_build.bat index 2c93ca4..8c3c356 100644 --- a/workspace/sync_build.bat +++ b/workspace/sync_build.bat @@ -1,4 +1,6 @@ echo off +SETLOCAL + set argC=0 for %%x in (%*) do Set /A argC+=1 if NOT "1" == "%argC%" ( @@ -15,15 +17,6 @@ if not "%YY%" == "20" (rem For Chinese date format set datetime=%YYYY%-%MM%-%DD%T%time: =0%0+0800 set devie_info=Win-%USERNAME% -set raw_data=[{^ -\"device_info\" :\"%devie_info%\",^ -\"project_info\" :\"%1\",^ -\"time\" :\"%datetime%\",^ -\"weight\" : 1^ -}] - -curl.exe --include --request POST --header "Content-Type: application/json" --data-binary^ - "%raw_data%" "%url%" rem ----------------- for GEO info ----------------- curl.exe ipinfo.io > ip_info.txt @@ -43,10 +36,24 @@ powershell -Command "(gc ip_org.txt) -replace '\"org\":', '' | Out-File -encodin powershell -Command "(gc ip_org.txt) -replace '""' , '' | Out-File -encoding ASCII ip_org.txt" powershell -Command "(gc ip_org.txt) -replace ',' , '' | Out-File -encoding ASCII ip_org.txt" -set url="https://api.powerbi.com/beta/72f988bf-86f1-41af-91ab-2d7cd011db47/datasets/d6c4145f-2fdc-4071-94f7-fbdb090914d4/rows?key=pQ7GFsXkAqJij4v%%2BadZDoth6HB%%2BmjZbAn0d%%2B%%2BtlWnE3jpm1s0lGKoFeFV7aF1QQ7PKOYGpQYYCkS0tjzxTgbLQ%%3D%%3D" set /p country=