test
Some checks failed
Sync Consul Config / sync (push) Failing after 1s

This commit is contained in:
xiaolipro 2026-09-08 14:12:17 +08:00
parent c04878423b
commit 9d38e2ae26

View File

@ -1,5 +1,5 @@
# push 到 main/master → 渲染密钥 → 写入 Consul → 重启相关 API
# runner: k3s-host(与 api 部署同一台,可访问 ClusterIP + kubectl)
# 触发方式与 api/front 一致(不做 paths 过滤,避免「推了却不跑」)
name: Sync Consul Config
on:
@ -10,15 +10,6 @@ on:
- "scripts/**"
- ".gitea/workflows/sync-consul.yml"
workflow_dispatch:
inputs:
targets:
description: "同步目标(空=全部;或 admin / common / itfxapi / trackapi,空格分隔)"
required: false
default: ""
restart:
description: "同步后重启 API(1/0)"
required: false
default: "1"
jobs:
sync:
@ -29,10 +20,6 @@ jobs:
set -euxo pipefail
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
export NAMESPACE=prod
export RESTART_APIS="${{ gitea.event.inputs.restart || '1' }}"
if [[ "${{ gitea.event_name }}" == "push" ]]; then
export RESTART_APIS=1
fi
REPO="${{ gitea.repository }}"
REPO="${REPO:-${{ github.repository }}}"
@ -58,10 +45,4 @@ jobs:
git checkout --force --quiet FETCH_HEAD
chmod +x scripts/sync-to-consul.sh
TARGETS="${{ gitea.event.inputs.targets }}"
if [[ -n "${TARGETS// /}" ]]; then
# shellcheck disable=SC2086
./scripts/sync-to-consul.sh $TARGETS
else
./scripts/sync-to-consul.sh
fi
./scripts/sync-to-consul.sh