Files
office_xbot_feishu/.woodpecker.yml
T
jianxinandClaude Opus 4.8 7b344356cc route registry traffic locally and re-enable kaniko cache
Build/deploy were hairpinning image layers through the public IP (registry.woni.link -> 47.100.75.125) despite the registry living on the same host. Add extra_hosts so the build pushes via the host internal IP, and re-enable kaniko cache now that host OOM is mitigated (swap + agent mem cap). Host /etc/hosts pins registry.woni.link to 127.0.0.1 for deploy pulls.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 17:17:06 +08:00

72 lines
1.7 KiB
YAML

when:
- event: push
branch:
include:
- main
- feature/*
steps:
- name: build
image: woodpeckerci/plugin-kaniko
# 把 registry 域名指到宿主机内网 IP, 镜像层推送走本地不绕公网
extra_hosts:
- "registry.woni.link:172.19.152.186"
settings:
username:
from_secret: registry_username
password:
from_secret: registry_password
tags: latest
repo: woni/office-xbot-feishu
registry: registry.woni.link
cache: true
cache_repo: woni/office-xbot-feishu-cache
mirrors:
- 5c492fmo.mirror.aliyuncs.com
dockerfile: ./Dockerfile
- name: scp
image: appleboy/drone-scp
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_user
port: 22
key:
from_secret: ssh_key
tags: 0.1
target: /home/docker/office-xbot-feishu
source: ./docker-compose.yaml
- name: deploy
image: appleboy/drone-ssh
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_user
port: 22
key:
from_secret: ssh_key
script:
- cd /home/docker/office-xbot-feishu
# - sudo sed -i "s#development#production#g" .flaskenv
- docker compose down
- docker compose rm
- docker compose pull
- docker compose --env-file .env up -d
- name: feishu
image: curlimages/curl:8.8.0
commands:
- >
curl -fsS -X POST "$FEISHU_WEBHOOK"
-H 'Content-Type: application/json'
-d '{"msg_type":"text","content":{"text":"部署成功"}}'
environment:
FEISHU_WEBHOOK:
from_secret: feishu_webhook
when:
- status: [failure, success]