converting loops
This commit is contained in:
1 parent
956158729e
commit
a1ebcfb6aa
5 files changed
+15
-15
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
# .agents/workflows
|
# .agents/looprails
|
||||||
|
|
||||||
nbot-wf workflow files for this repo.
|
Looprail files for this repo.
|
||||||
|
|
||||||
## journal-triage
|
## journal-triage
|
||||||
|
|
||||||
@@ -15,4 +15,4 @@ against this repo, and writes a report ranked by urgency to `.tmp/journal-report
|
|||||||
- Inputs: `since` (default `24 hours ago`), `priority` (`err`, `warning`, `notice`),
|
- Inputs: `since` (default `24 hours ago`), `priority` (`err`, `warning`, `notice`),
|
||||||
`host` (default `fwbook`), `repo` (default `/home/ari/nixos-setup`).
|
`host` (default `fwbook`), `repo` (default `/home/ari/nixos-setup`).
|
||||||
|
|
||||||
Run: `nbot-wf run .agents/workflows/journal-triage.toml`, or ask the agent to run it.
|
Run: `looprail run .agents/looprails/journal-triage.toml`, or ask the agent to run it.
|
||||||
@@ -11,7 +11,7 @@ repo = { type = "string", description = "Path of the NixOS config repo.", min_le
|
|||||||
kind = "shell"
|
kind = "shell"
|
||||||
description = "Collects journal warnings and failed units into a digest."
|
description = "Collects journal warnings and failed units into a digest."
|
||||||
cwd = "{{ inputs.repo }}"
|
cwd = "{{ inputs.repo }}"
|
||||||
run = ["/usr/bin/env", "sh", ".agents/workflows/journal-triage/collect.sh {{ inputs.since }} {{ inputs.priority }}"]
|
run = ["sh .agents/looprails/journal-triage/collect.sh {{ inputs.since }} {{ inputs.priority }}"]
|
||||||
|
|
||||||
[step.collect.outputs]
|
[step.collect.outputs]
|
||||||
raw_log = { type = "string", description = "Path of the full raw journal log." }
|
raw_log = { type = "string", description = "Path of the full raw journal log." }
|
||||||
@@ -38,7 +38,7 @@ description = "Writes the report to .tmp/journal-reports."
|
|||||||
needs = ["triage"]
|
needs = ["triage"]
|
||||||
run = [
|
run = [
|
||||||
"R={{ inputs.repo }}; mkdir -p \"$R/.tmp/journal-reports\"",
|
"R={{ inputs.repo }}; mkdir -p \"$R/.tmp/journal-reports\"",
|
||||||
"S={{ steps.triage.outputs.summary }}; H={{ inputs.host }}; R={{ inputs.repo }}; f=\"$R/.tmp/journal-reports/$H-$(date +%Y-%m-%d-%H%M).md\"; printf '%s\\n' \"$S\" > \"$f\"; echo \"report=$f\" >> \"$NBOT_WF_OUTPUTS\"; echo \"Report written to $f\"",
|
"S={{ steps.triage.outputs.summary }}; H={{ inputs.host }}; R={{ inputs.repo }}; f=\"$R/.tmp/journal-reports/$H-$(date +%Y-%m-%d-%H%M).md\"; printf '%s\\n' \"$S\" > \"$f\"; echo \"report=$f\" >> \"$NBOT_LR_OUTPUTS\"; echo \"Report written to $f\"",
|
||||||
]
|
]
|
||||||
|
|
||||||
[step.report.outputs]
|
[step.report.outputs]
|
||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
# Collect journald warnings+ and failed units into the run folder, plus a deduplicated digest.
|
# Collect journald warnings+ and failed units into the run folder, plus a deduplicated digest.
|
||||||
set -eu
|
set -eu
|
||||||
since="$1"; priority="$2"
|
since="$1"; priority="$2"
|
||||||
dir="$NBOT_WF_RUN_DIR"
|
dir="$NBOT_LR_RUN_DIR"
|
||||||
raw="$dir/journal-raw.log"; digest="$dir/journal-digest.txt"
|
raw="$dir/journal-raw.log"; digest="$dir/journal-digest.txt"
|
||||||
|
|
||||||
journalctl -p "$priority" --since "$since" --no-pager -q -o short-iso > "$raw" || true
|
journalctl -p "$priority" --since "$since" --no-pager -q -o short-iso > "$raw" || true
|
||||||
@@ -23,4 +23,4 @@ journalctl -p "$priority" --since "$since" --no-pager -q -o short-iso > "$raw" |
|
|||||||
|
|
||||||
lines=$(wc -l < "$raw")
|
lines=$(wc -l < "$raw")
|
||||||
uniq=$(grep -c '^ *[0-9]' "$digest" || true)
|
uniq=$(grep -c '^ *[0-9]' "$digest" || true)
|
||||||
printf 'raw_log=%s\ndigest=%s\nlines=%s\nunique=%s\n' "$raw" "$digest" "$lines" "$uniq" >> "$NBOT_WF_OUTPUTS"
|
printf 'raw_log=%s\ndigest=%s\nlines=%s\nunique=%s\n' "$raw" "$digest" "$lines" "$uniq" >> "$NBOT_LR_OUTPUTS"
|
||||||
File renamed without changes.
Generated
+8
-8
@@ -2143,11 +2143,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1794866996,
|
"lastModified": 1794942815,
|
||||||
"narHash": "sha256-q9sqHlAVgxmQltqKCUKkljUH514cnOTB8kdgDdr7yqY=",
|
"narHash": "sha256-YVZcT7Kqt0eYOTrjCPAreZHe0heKSJhcPnN54XU/vVc=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "75795eb4ff891ca64306a962dd6308309cfdf794",
|
"rev": "9d5f57eb36661e76fb1160591484a323dde4f6b8",
|
||||||
"revCount": 21,
|
"revCount": 91,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://git@github.com/SkyG-Org/LoopRail.git"
|
"url": "ssh://git@github.com/SkyG-Org/LoopRail.git"
|
||||||
},
|
},
|
||||||
@@ -2244,11 +2244,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1794921139,
|
"lastModified": 1794935764,
|
||||||
"narHash": "sha256-YlykKn/+zvpBGsxbFcPcEczOBLguXwFrWjEK1W07diA=",
|
"narHash": "sha256-MNWm/NWTMaWj3VW/9uIVJ5yEHpeh0qdvSf+fP2/BCFI=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "bdc877dd20d3f2389228ef2a3d25f4c1800a71ce",
|
"rev": "dec5099a1db1bf0c85d28c066f5f551fd9f635c8",
|
||||||
"revCount": 1627,
|
"revCount": 1636,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://git@github.com/SkyG-Org/nBot.git"
|
"url": "ssh://git@github.com/SkyG-Org/nBot.git"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user