music(chord): 加 yopu.co 吉他谱自动抓取(sidecar 模式)
deploy cube / build-and-deploy (push) Successful in 1m15s
deploy simpleasm / build-and-deploy (push) Successful in 1m19s
deploy music / build-and-deploy (push) Successful in 4m38s

复刻 ../guitar 的功能:
- 新加 chord-fetcher sidecar(python 3.11 + chromium + selenium),跟 main 同 pod 共享 PVC
- yopu.py v2:搜「和弦谱」→ 进 view → 选 谱面样式=功能谱 + 和弦样式=级数名 → 截 sheet-container → PIL 裁白边
- music backend 加 POST /api/pieces/:id/chord/fetch + GET /chord/status,转发 sidecar 并把 png import 成 image attachment role=chord
- 前端 chord tab 在没图时显示「自动抓取」按钮,点了 polling 状态、完成后刷新
- CI build 两个 image(music + music-chord),rollout 同步切版本
This commit is contained in:
Fam Zheng
2026-05-09 22:52:09 +01:00
parent 1a8f297302
commit e111398157
11 changed files with 1688 additions and 12 deletions
+12 -3
View File
@@ -19,6 +19,7 @@ jobs:
APP: music
NS: cube-music
IMAGE: registry.famzheng.me/mochi/music
CHORD_IMAGE: registry.famzheng.me/mochi/music-chord
steps:
- uses: actions/checkout@v4
@@ -38,13 +39,19 @@ jobs:
npm ci
npm run build
- name: Build & push image
- name: Build & push images
env:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
echo "$REGISTRY_TOKEN" | docker login registry.famzheng.me -u mochi --password-stdin
# main app
docker build -f "apps/$APP/Dockerfile" -t "$IMAGE:${{ steps.tag.outputs.sha }}" .
docker push "$IMAGE:${{ steps.tag.outputs.sha }}"
# chord-fetcher sidecar (python + chromium)
docker build -f "apps/$APP/chord/Dockerfile" \
-t "$CHORD_IMAGE:${{ steps.tag.outputs.sha }}" \
"apps/$APP/chord"
docker push "$CHORD_IMAGE:${{ steps.tag.outputs.sha }}"
- name: Initialize K8s resources
run: |
@@ -52,5 +59,7 @@ jobs:
- name: Roll out to k3s
run: |
kubectl -n "$NS" set image "deploy/$APP" "$APP=$IMAGE:${{ steps.tag.outputs.sha }}"
kubectl -n "$NS" rollout status "deploy/$APP" --timeout=120s
kubectl -n "$NS" set image "deploy/$APP" \
"$APP=$IMAGE:${{ steps.tag.outputs.sha }}" \
"chord-fetcher=$CHORD_IMAGE:${{ steps.tag.outputs.sha }}"
kubectl -n "$NS" rollout status "deploy/$APP" --timeout=300s