Commit 94bc65ad authored by Zhang Xiaoli's avatar Zhang Xiaoli
Browse files

测试新格式msg-all.txt消息处理,先解析流水线名称提取消息,再进行处理

parent b5500664
#!/bin/bash
msgall="/nfsdata/share/simulation-collection/msc/v093/raw/msg-all.txt"
#msgall="./msg.txt"
jobName=$1
echo "$jobName"
sls=$(jq -r 'select(.image == "csst-msc-l1-mbi") | .message' "$msgall")
#sls=$(jq -r 'select(.image == "$jobName") | .message' "$msgall")
# 移除可能存在的尾随换行符(如果jq输出格式包含换行符作为分隔符)
#sls="${sls%$'\n'}"
# 判断sls变量是否为空
if [ -z "$sls" ]; then
echo "No $jobName found."
else
echo "add message to sls.txt, and scalebox add $jobName:"
echo "$sls" > $jobName".txt"
# scalebox task add --task-file=$sls --sink-job=$jobName
fi
#while IFS= read -r line
#do
# json_string="$line"
# echo "msg-all:$json_string"
#jobName=$(echo "$json_string" | jq -r '.image')
#msg=$(echo "$json_string" | jq -r '.message')
#echo $jobName $msg
# 构建命令
#cmd="scalebox task add scalebox task add --sink-job=$jobName \"$msg\""
#done < $jobName".txt"
#~
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment