Skip to content

Commit 715f12a

Browse files
authored
write to file (#627)
1 parent 7ad0b23 commit 715f12a

File tree

1 file changed

+36
-28
lines changed

1 file changed

+36
-28
lines changed

utils/index.sh

+36-28
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ setup(){
2121
export ci="JENKINS"
2222
export build_url=${BUILD_URL}
2323
fi
24+
2425
export UUID=$UUID
2526
# Elasticsearch Config
2627
export ES_SERVER=$ES_SERVER
@@ -50,35 +51,42 @@ setup(){
5051
}
5152

5253
index_task(){
54+
5355
url=$1
54-
curl --insecure -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
55-
"ciSystem" : "'$ci'",
56-
"uuid" : "'$UUID'",
57-
"releaseStream": "'$RELEASE_STREAM'",
58-
"platform": "'$platform'",
59-
"clusterType": "'$cluster_type'",
60-
"benchmark": "'$WORKLOAD'",
61-
"masterNodesCount": '$masters',
62-
"workerNodesCount": '$workers',
63-
"infraNodesCount": '$infra',
64-
"masterNodesType": "'$master_type'",
65-
"workerNodesType": "'$worker_type'",
66-
"infraNodesType": "'$infra_type'",
67-
"totalNodesCount": '$all',
68-
"clusterName": "'$cluster_name'",
69-
"ocpVersion": "'$cluster_version'",
70-
"networkType": "'$network_type'",
71-
"buildTag": "'$task_id'",
72-
"jobStatus": "'$state'",
73-
"buildUrl": "'$build_url'",
74-
"upstreamJob": "'$job_id'",
75-
"upstreamJobBuild": "'$job_run_id'",
76-
"executionDate": "'$execution_date'",
77-
"jobDuration": "'$duration'",
78-
"startDate": "'"$start_date"'",
79-
"endDate": "'"$end_date"'",
80-
"timestamp": "'"$start_date"'"
81-
}' "$url"
56+
uuid_dir=/tmp/$UUID
57+
mkdir $uuid_dir
58+
59+
json_data='{
60+
"ciSystem":"'$ci'",
61+
"uuid":"'$UUID'",
62+
"releaseStream":"'$RELEASE_STREAM'",
63+
"platform":"'$platform'",
64+
"clusterType":"'$cluster_type'",
65+
"benchmark":"'$WORKLOAD'",
66+
"masterNodesCount":'$masters',
67+
"workerNodesCount":'$workers',
68+
"infraNodesCount":'$infra',
69+
"masterNodesType":"'$master_type'",
70+
"workerNodesType":"'$worker_type'",
71+
"infraNodesType":"'$infra_type'",
72+
"totalNodesCount":'$all',
73+
"clusterName":"'$cluster_name'",
74+
"ocpVersion":"'$cluster_version'",
75+
"networkType":"'$network_type'",
76+
"buildTag":"'$task_id'",
77+
"jobStatus":"'$state'",
78+
"buildUrl":"'$build_url'",
79+
"upstreamJob":"'$job_id'",
80+
"upstreamJobBuild":"'$job_run_id'",
81+
"executionDate":"'$execution_date'",
82+
"jobDuration":"'$duration'",
83+
"startDate":"'"$start_date"'",
84+
"endDate":"'"$end_date"'",
85+
"timestamp":"'"$start_date"'"
86+
}'
87+
echo $json_data >> $uuid_dir/index_data.json
88+
curl --insecure -X POST -H "Content-Type:application/json" -H "Cache-Control:no-cache" -d "$json_data" "$url"
89+
8290
}
8391

8492
set_duration(){

0 commit comments

Comments
 (0)