Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
csst
Scalebox Apps
Commits
94bc65ad
Commit
94bc65ad
authored
Nov 21, 2024
by
Zhang Xiaoli
Browse files
测试新格式msg-all.txt消息处理,先解析流水线名称提取消息,再进行处理
parent
b5500664
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
L1/pipelines/pipeline-nao/test.sh
L1/pipelines/pipeline-nao/test.sh
+42
-0
No files found.
L1/pipelines/pipeline-nao/test.sh
0 → 100644
View file @
94bc65ad
#!/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"
#~
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment