Skip to content

feat: CI-gated autodeploy with release tracking and watch-window rollback - #9

Merged
Avazbek22 merged 1 commit into
mainfrom
feat/robust-autodeploy
Sep 28, 2026
Merged

Avazbek22 merged 1 commit into
mainfrom
feat/robust-autodeploy

Conversation

@Avazbek22

Copy link
Copy Markdown
Owner

Summary

Moves VideoDownloaderBot to the deployment layer of the current telegram-bot-autodeploy-template, with the nightly yt-dlp refresh folded into it.

  • CI gate: the VPS deploys a commit only after its GitHub checks pass, or after 30 minutes if CI never starts.
  • Real health: healthy only while the download workers run and Telegram answered getUpdates within 90 seconds. A stale poll reports unhealthy without stopping the bot, and it recovers on its own.
  • Releases as commit plus exact image, a ten-minute watch window with automatic rollback, recovery of interrupted deployments, and an undoable manual rollback (scripts/rollback.sh).
  • Nightly yt-dlp rebuild through deploy.conf (REBUILD_STAMP + REBUILD_VERSION_CMD): the bot restarts only when yt-dlp has a new version, with the same checks and rollback as any deploy. scripts/update-ytdlp.sh and its timer are removed; the installer disables the old timer on the server.
  • Smoke test still checks imports, ffmpeg, ffprobe, Node, yt-dlp, and getMe. The one-line bash <(curl …) installer keeps working.
  • ruff format on main.py and app/planner.py, which made CI fail on main since 2026-09-19. Formatting only.

Tests

  • 91 Python tests, including stale-poll health and poll recording.
  • Deployment shell tests with real Git repositories (41 scenarios).

🤖 Generated with Claude Code

…back

Replace the deployment scripts with the current template's and fold the
nightly yt-dlp updater into it:

- Deploy only commits whose GitHub checks passed, or after 30 minutes when
  CI never starts.
- Report healthy only while the download workers run and Telegram answers
  getUpdates; a stale poll marks the bot unhealthy without stopping it.
- Record releases as commit plus exact image, watch fresh releases for ten
  minutes, and roll back automatically; manual rollback can be undone.
- Rebuild nightly with REBUILD_STAMP and restart only when
  `python -m yt_dlp --version` changes; the installer removes the old
  yt-dlp updater timer.
- Deploy commits that do not change the image without a restart.
- Run git as the checkout owner; keep the one-line curl installer.
- Apply ruff formatting to main.py and app/planner.py, which failed CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Avazbek22
Avazbek22 merged commit 28bf705 into main Sep 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant