Skip to content

Commit d371c6d

Browse files
committed
chore: use config/config.yaml
1 parent 5be1ca8 commit d371c6d

27 files changed

+113
-187
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/runner-agent
99
*.exe
1010
runners
11-
config.yaml
11+
config/config.yaml
1212
.env
1313
*.test
1414
*.out

.env.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
# MANAGER_IMAGE=ghcr.io/soulteary/runner-fleet:v1.0.0
99
# 开发/尝鲜可使用 main:MANAGER_IMAGE=ghcr.io/soulteary/runner-fleet:main
1010
#
11-
# config.yaml 中未设置 container_image 时,Manager 内默认 Runner 镜像:优先从 MANAGER_IMAGE 推导(如 v1.0.0 -> v1.0.0-runner),否则由 FLEET_IMAGE_TAG 决定(未设则为 v1.0.0)。
11+
# config/config.yaml 中未设置 container_image 时,Manager 内默认 Runner 镜像:优先从 MANAGER_IMAGE 推导(如 v1.0.0 -> v1.0.0-runner),否则由 FLEET_IMAGE_TAG 决定(未设则为 v1.0.0)。
1212
# 例如使用 main 版 Runner 镜像:FLEET_IMAGE_TAG=main
1313
#
14-
# 宿主机映射端口,默认 8080(同时覆盖 config.yaml 中 server.port)
14+
# 宿主机映射端口,默认 8080(同时覆盖 config/config.yaml 中 server.port)
1515
# MANAGER_PORT=8080
1616
#
1717
# Job 内 Docker 使用 DinD(仅非容器模式时有效)。容器模式下请勿设置此项,Manager 必须用宿主机 socket。
@@ -25,7 +25,7 @@
2525
# BASIC_AUTH_USER=admin # 可选,默认 admin
2626
# BASIC_AUTH_PASSWORD= # 设置后启用 Basic Auth,留空则不鉴权
2727
#
28-
# === 以下用于覆盖 config.yaml,便于全容器部署(仅改 .env 即可,无需改 config.yaml)===
28+
# === 以下用于覆盖 config/config.yaml,便于全容器部署(仅改 .env 即可,无需改配置文件)===
2929
# CONTAINER_MODE=true
3030
# RUNNER_IMAGE=ghcr.io/soulteary/runner-fleet:v1.0.0-runner # 不设则从 MANAGER_IMAGE 自动推导
3131
# CONTAINER_NETWORK=runner-net

.github/workflows/ci-manager.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ jobs:
9191

9292
- name: Init example config
9393
if: steps.modroot.outputs.found == 'true'
94-
run: cp config.yaml.example config.yaml
94+
run: mkdir -p config && cp config.yaml.example config/config.yaml
9595
working-directory: ${{ steps.modroot.outputs.root }}
9696

9797
- name: Verify binary
9898
if: steps.modroot.outputs.found == 'true'
9999
run: |
100100
./runner-manager -version
101-
./runner-manager -config config.yaml &
101+
./runner-manager -config config/config.yaml &
102102
PID=$!
103103
trap "kill $PID 2>/dev/null || true; wait $PID 2>/dev/null || true" EXIT
104104
for i in 1 2 3 4 5; do sleep 1; curl -sf http://localhost:8080/health | grep -q '"status":"ok"' && break; done

.github/workflows/publish-image-manager.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
type=semver,pattern={{major}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
101101
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
102102
103-
# Dockerfile 内已 COPY config.yaml.example 并 sed 为 config.yaml,无需在 workflow 中准备
103+
# Dockerfile 内已 COPY config.yaml.example 为 config/config.yaml 并 sed,无需在 workflow 中准备
104104

105105
- name: Build and push Manager image
106106
if: steps.verify.outputs.has_go_source == 'true'

.github/workflows/release-manager.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
cd dist
6767
sha256sum * > checksums.txt
6868
69-
# Dockerfile 内已 COPY config.yaml.example 并 sed 为 config.yaml,无需在 workflow 中准备
69+
# Dockerfile 内已 COPY config.yaml.example 为 config/config.yaml 并 sed,无需在 workflow 中准备
7070

7171
- name: Set up QEMU
7272
uses: docker/setup-qemu-action@v3

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# **/.github_check_token
1010

1111
# 本地配置(若含敏感信息建议加入)
12-
config.yaml
12+
config/config.yaml
1313
.env
1414

1515
# IDE

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ RUN install -m 0755 -d /etc/apt/keyrings \
2929
RUN groupadd -g 1001 app && useradd -r -u 1001 -g app -d /app -s /bin/bash app
3030
WORKDIR /app
3131
COPY --from=builder /app/runner-manager .
32-
COPY config.yaml.example ./config.yaml
32+
COPY config.yaml.example ./config/config.yaml
3333
COPY scripts/install-runner.sh /app/scripts/install-runner.sh
34-
RUN sed -i 's|base_path: ./runners|base_path: /app/runners|' config.yaml \
34+
RUN sed -i 's|base_path: ./runners|base_path: /app/runners|' config/config.yaml \
3535
&& mkdir -p /app/runners \
3636
&& chmod +x /app/scripts/install-runner.sh && chown -R app:app /app
3737

@@ -40,4 +40,4 @@ EXPOSE 8080
4040
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
4141
CMD curl -fsS http://127.0.0.1:8080/health || exit 1
4242
ENTRYPOINT ["./runner-manager"]
43-
CMD ["-config", "/app/config.yaml"]
43+
CMD ["-config", "/app/config/config.yaml"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ docker-build-runner:
3333
# 需 Basic Auth 时请使用 docker compose(会读取 .env),或在本 target 的 docker run 中增加 -e BASIC_AUTH_PASSWORD=... -e BASIC_AUTH_USER=admin
3434
docker-run: docker-stop
3535
docker run -d --name runner-manager -p 8080:8080 \
36-
-v $(PWD)/config.yaml:/app/config.yaml \
36+
-v $(PWD)/config:/app/config \
3737
-v $(PWD)/runners:/app/runners \
3838
runner-manager:$(VERSION)
3939

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ HTTP management UI built with Golang Echo to view and manage multiple self-hoste
2929
## Quick start
3030

3131
```bash
32-
cp config.yaml.example config.yaml
33-
# Edit config.yaml: set runners.base_path to /app/runners
34-
# On host: mkdir -p runners && chown 1001:1001 config.yaml runners
32+
mkdir -p config && cp config.yaml.example config/config.yaml
33+
# Edit config/config.yaml: set runners.base_path to /app/runners
34+
# On host: mkdir -p runners && chown 1001:1001 config runners
3535

3636
docker network create runner-net 2>/dev/null || true
3737
docker compose up -d

cmd/runner-manager/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func newTemplateRenderer() *templateRenderer {
5454
}
5555

5656
func main() {
57-
configPath := flag.String("config", "config.yaml", "配置文件路径")
57+
configPath := flag.String("config", "config/config.yaml", "配置文件路径")
5858
showVersion := flag.Bool("version", false, "显示版本号后退出")
5959
flag.Parse()
6060

0 commit comments

Comments
 (0)