Files
qbit-maid/.gitea/workflows/komodo-setup.yml
T
Jonathan Branan 671b705b39
Komodo Setup (throwaway) / inspect (push) Successful in 2s
chore: fix yaml indent
2026-10-27 01:38:39 -05:00

47 lines
1.7 KiB
YAML

name: Komodo Setup (throwaway)
on:
push:
branches:
- komodo-setup
workflow_dispatch:
jobs:
inspect:
runs-on: ubuntu-latest
steps:
- name: Inspect Komodo
env:
KOMODO_URL: ${{ secrets.KOMODO_URL }}
KOMODO_API_KEY: ${{ secrets.KOMODO_API_KEY }}
KOMODO_API_SECRET: ${{ secrets.KOMODO_API_SECRET }}
run: |
set -eu
KOMODO_URL="${KOMODO_URL%/}"
api() {
curl -sS -X POST "${KOMODO_URL}$1" \
-H 'Content-Type: application/json' \
-H "x-api-key: ${KOMODO_API_KEY}" \
-H "x-api-secret: ${KOMODO_API_SECRET}" \
-d "$2"
}
echo "=== GetRepo 6ac99726aff03b84cf6d39d7 ==="
api /read/GetRepo '{"repo":"6ac99726aff03b84cf6d39d7"}' | python3 -m json.tool
echo "=== ListStacks (summary) ==="
api /read/ListStacks '{}' > /tmp/stacks.json
python3 - <<'PY'
import json
for s in json.load(open("/tmp/stacks.json")):
c = s.get("config", {})
print(s["name"], "| server:", c.get("server_id"), "| repo:", c.get("linked_repo"),
"| branch:", c.get("branch"), "| rundir:", c.get("run_directory"),
"| files_on_host:", c.get("files_on_host"), "| file_paths:", c.get("file_paths"))
PY
echo "=== ListRepos ==="
api /read/ListRepos '{}' > /tmp/repos.json
python3 - <<'PY'
import json
for r in json.load(open("/tmp/repos.json")):
print(r["id"], r["name"], r.get("config", {}).get("repo"), r.get("config", {}).get("path"))
PY