Skip to content

Instantly share code, notes, and snippets.

@avoidwork
Created April 10, 2026 11:56
Show Gist options
  • Select an option

  • Save avoidwork/8756ad4cd22c8ec430f3f689fb2fd15d to your computer and use it in GitHub Desktop.

Select an option

Save avoidwork/8756ad4cd22c8ec430f3f689fb2fd15d to your computer and use it in GitHub Desktop.
Gotham Stacks management
{
"id": "8dd5cd4a-6dc2-41f6-a37f-a7fca4255b72",
"name": "Gotham Stack Deployment Version Update - 4x Daily",
"description": "Scan k8s deployment manifests in gotham-stacks repo and update container versions to latest verified available versions",
"enabled": true,
"schedule": {
"expr": "0 */6 * * *",
"kind": "cron",
"tz": "America/Toronto"
},
"sessionTarget": "session:agent:main:main",
"wakeMode": "now",
"payload": {
"kind": "agentTurn",
"message": "🔧 **Gotham Stack Deployment Version Update**\n\nUse the opencode-coding-agent skill to work with the gotham-stacks repository on the opencode LXC.\n\n**Task:**\n1. SSH to LXC using: `ssh -i /home/node/.openclaw/workspace/ssh-keys/opencode-lxc jason@10.1.2.8`\n2. Navigate to ~/projects/gotham-stacks on the LXC\n3. **Create a unique feature branch** from the updated default branch (main/master):\n - Branch name format: `feature/deployment-version-update-YYYY-MM-DD-HHMM`\n - Example: `feature/deployment-version-update-2026-04-09-1800` (6:00 PM run)\n - Example: `feature/deployment-version-update-2026-04-09-0600` (6:00 AM run)\n - Must create a NEW branch each run (time-based naming ensures uniqueness)\n4. Scan all k8s deployment manifest files for container image version updates\n5. **Process all deployments within each manifest file** - find every `image:` field and check for updates\n6. **Process files one at a time** to avoid excess context size - read, update, and stage each manifest individually\n7. Update versions to latest verified available in the registry\n8. Commit with: `chore: update deployment container versions to latest verified -- Signed-off-by: Mads <openclaw>`\n9. Push the feature branch to GitHub\n10. **Create a pull request using `gh` CLI:**\n - `gh pr create --base main --head feature/deployment-version-update-YYYY-MM-DD-HHMM --title 'chore: update deployment container versions' --body 'Automated container version update from Gotham Stack cron job'`\n\n**Rules:**\n- NEVER update deployments without explicit version tags\n- NEVER commit to default/main branch - always use unique feature branches with date+time\n- Include signature in every commit\n- Each cron run must create a fresh branch (timestamp naming ensures uniqueness even for multiple daily runs)\n- PR must be created for review before merging\n- **Prefer 'alpine' releases** if present in the registry (e.g., `image:xxx:1.2.3-alpine` over `image:xxx:1.2.3`)\n- **Semantic version check only** - only update if new version is HIGHER than current (e.g., 1.2.4 > 1.2.3, but 1.2.2 < 1.2.3)\n- Do NOT downgrade versions - compare major.minor.patch numerically\n- **Skip images with 'docker' in the tag/name** - do NOT download or update these (security risk)\n- **Ignore 'latest' tag** - only use explicit semantic version tags (e.g., 1.2.3, not latest)\n- **VERIFY tag format BEFORE writing** - validate the final tag matches `X.Y.Z` or `X.Y.Z-suffix` format (no 'v' prefix, valid semantic version). If tag has 'v' prefix, DO NOT use it - find the correct tag without 'v'\n- Search registry for newest semantic version tag when updating\n- **Use Docker Hub tags API** to find versions: `https://hub.docker.com/r/<image-name>/tags?page_size=20&ordering=last_updated` (use `jq` to parse JSON responses)\n- **Fallback URL if first fails:** `https://hub.docker.com/_/<image-name>/tags?page_size=20&ordering=last_updated` (for official images)\n- **For GitHub-hosted images, use GitHub Releases API:** `https://api.github.com/repos/<owner>/<repo>/releases?per_page=10` (use `jq` to parse JSON responses)\n- **Ignore breaking versions** - skip major version jumps that may introduce breaking changes (e.g., 1.x.x → 2.x.x requires manual review)\n- **Preserve tag metadata suffix** - if current tag has no suffix (e.g., `1.2.3`), don't add one (e.g., don't upgrade to `1.2.3-ubuntu`); if current tag has `-alpine`, stay with `-alpine` variants only\n- **Process all deployments** - find and update every `image:` field in each manifest file\n- **Process files one at a time** - read, update, and stage each manifest individually to avoid context overflow\n\nUse `opencode --prompt \"Scan k8s deployment manifests in @media.yaml & @lab.yaml for container image version updates. Prefer 'alpine' tagged releases if available. Only update if new version is a higher semantic version (major.minor.patch) than current. IGNORE tags containing 'docker' and ignore 'latest' tag - only use explicit semantic version tags. VERIFY tag format BEFORE writing - validate final tag matches X.Y.Z or X.Y.Z-suffix regex pattern (no v prefix, valid semver). If tag has v prefix, DO NOT use it - find the correct tag without v. Use Docker Hub tags API (e.g., https://hub.docker.com/r/linuxserver/sonarr/tags?page_size=20&ordering=last_updated or https://hub.docker.com/_/redis/tags?page_size=20&ordering=last_updated for official images) with jq to parse JSON responses, sorted by latest first. For GitHub-hosted images, use GitHub Releases API (e.g., https://api.github.com/repos/openclaw/openclaw/releases?per_page=10) with jq to parse JSON. IGNORE breaking versions (major version jumps like 1.x.x → 2.x.x require manual review). PRESERVE tag metadata suffix - if current tag has no suffix (e.g., 1.2.3), don't add one (e.g., don't upgrade to 1.2.3-ubuntu); if current tag has -alpine, stay with -alpine variants only. Process ALL deployments within each manifest file - find every image: field and check for updates. Process files one at a time to avoid excess context size. Create feature branch with today's date and current time (YYYY-MM-DD-HHMM format), commit with signature, push to GitHub, and create a pull request using gh CLI.\"` mode for this task. SSH key is at `/home/node/.openclaw/workspace/ssh-keys/opencode-lxc`. Model selection is handled by opencode config.",
"timeoutSeconds": 1800,
"toolsAllow": ["opencode-coding-agent"]
},
"delivery": {
"mode": "announce",
"channel": "webchat"
},
"state": {
"nextRunAtMs": 1775837020277,
"lastRunAtMs": 1775815420290,
"lastRunStatus": "error",
"lastError": "Delivering to Telegram requires target <chatId>"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment