# 发布流程(每次更新必做) > 目标:任何一次改动都带着完整记录推到 Gitea,README 面向用户、CHANGELOG 面向历史,两者都不落下。 ## 1. 改动落地(容器内) ```bash # 改完容器内文件后,务必 node --check 通过再固化 docker commit katelyatv katelyatv:fixedNN # 镜像名固定用 fixedNN 累加 sed -i 's|katelyatv:fixedNN-1|katelyatv:fixedNN|' docker-compose.redis.yml docker compose -f docker-compose.redis.yml up -d ``` ## 2. 浏览器实测验证 改 UI 必须登录后在真实页面上验证(登录接口见运维记录),不能只看日志。 ## 3. 写更新日志(两处,缺一不可) 1. **CHANGELOG.md** 顶部新增一节:`## 日期 → v-fixedNN`,列清改了什么 2. **README.md** 的「📝 更新日志(最近)」列表顶部插入同一条,保持最近 8 条左右,超出的删掉(完整历史在 CHANGELOG.md) ## 4. README 检查项(每次发布前过一遍) - [ ] 体验地址 `https://tv.88531.cn` 在标题下方显眼位置 - [ ] 增强功能列表与实际功能一致(新加的功能要补进去) - [ ] 安装步骤可照抄执行(`.env.example` 同步更新) - [ ] 「当前镜像 fixedNN」的版本号与 compose 一致 ## 5. 推送 Gitea ```bash cd /vol1/1000/HD1/docker/katelyatv git add -A git -c user.name="jinghui" commit -m "v-fixedNN:<一句话说明>" git remote set-url origin "http://jinghui:$(cat /root/.gitea_api_token)@192.168.68.19:3200/jinghui/katelyatv.git" git push -q origin main git remote set-url origin "http://192.168.68.19:3200/jinghui/katelyatv.git" # 还原,勿把 token 留在 remote ``` ## 镜像推送到公共容器仓库(每次发版必做) ```bash # LAN 直推(daemon 已配 insecure-registries: 192.168.68.19:3200;公网域名走 frp 中转会超时,勿用) docker tag katelyatv:fixedNN 192.168.68.19:3200/jinghui/katelyatv:fixedNN docker tag katelyatv:fixedNN 192.168.68.19:3200/jinghui/katelyatv:latest docker push 192.168.68.19:3200/jinghui/katelyatv:fixedNN docker push 192.168.68.19:3200/jinghui/katelyatv:latest # 验证(公网域名 + 匿名可拉) curl -s "https://gitea.88531.cn/v2/jinghui/katelyatv/tags/list" DOCKER_CONFIG=/tmp/emptydockercfg docker pull gitea.88531.cn/jinghui/katelyatv:latest ``` - Docker 登录 token(`write:package` 作用域):`/root/.gitea_docker_token` (生成:`docker exec -u git gitea gitea admin user generate-access-token --username jinghui --scopes write:package,read:package`),勿入库 - README「拉取镜像」示例 tag 随版本同步更新 **同步推腾讯云 TCR(东京区,第二拉取渠道,每次发版一起推):** ```bash docker tag katelyatv:fixedNN jpccr.ccs.tencentyun.com/jinghui/katelyatv:fixedNN docker tag katelyatv:fixedNN jpccr.ccs.tencentyun.com/jinghui/katelyatv:latest docker push jpccr.ccs.tencentyun.com/jinghui/katelyatv:fixedNN docker push jpccr.ccs.tencentyun.com/jinghui/katelyatv:latest # 验证(带凭据查 tag;匿名拉取测公开性) curl -s --noproxy '*' -u <账号ID>:<密码> 'https://jpccr.ccs.tencentyun.com/service/token?...' # 凭据见 /root/.image_publish_creds.md,勿入库 DOCKER_CONFIG=/tmp/emptydockercfg docker pull jpccr.ccs.tencentyun.com/jinghui/katelyatv:latest ``` - 登录用户名 = 腾讯云账号 ID(不是自定义名),命名空间 = 控制台已建的 `jinghui`;报 `another ccr account` 即命名空间不对 - 个人版仓库默认私有挡匿名 pull;**改公开用云 API 秒批**(本机 20 仓已全量公开):TC3 签名调 `ModifyRepositoryAccessPersonal`(`RepoName=jinghui/<名>`, `Public=1`, Region `ap-tokyo`,密钥 `/root/.tencent_api_creds`);核验 = 匿名取 token 后 `GET /v2/jinghui/<名>/tags/list` 200;注意 `DescribeRepositoryFilterPersonal` 列表会漏个别仓库(用 `ValidateRepositoryExistPersonal` 兜底) - 仓库私有不挡 push,只挡匿名 pull ## 发版后:授权中心登记版本行(触发「发现新版本」推送) 镜像双渠道推完后,在 CardAuth(`auth.88531.cn`,project **11**)登记本次版本: ```bash # SQL 走 /tmp/run_ann.sh(远端脚本,参数=SQL 文件);脚本与 SQL 见 /root/ 或会话 scratch # INSERT INTO ca_project_versions (project_id, version, changelog, download_url, released_at) ... # 注意:发版前插入会让现网 fixed35 站点自报客户端版本=fixed35,不弹;旧版实例会弹 ``` - 心跳里客户端上报 `SITE_VERSION`(compose env),中心据此判定 `update_available` - 公告在 `ca_announcements` 插 `project_id=11` 行即 60s 内全网推送 ## 硬规则 - `.env`、镜像 tar、token 永不入库(`.gitignore` 已覆盖) - GitHub 上游链接(`github.com/katelya77/KatelyaTV` 等)不改名,改了会失效 - 容器一律 `restart: always`,compose 改动后核验