Skip to content

Commit 3ef3a83

Browse files
authored
feat: 同步cnb,调整docker-compose (#35)
1 parent a4451af commit 3ef3a83

File tree

2 files changed

+61
-23
lines changed

2 files changed

+61
-23
lines changed

.github/workflows/sync-to-cnb.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Sync to CNB
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# 可以手动触发
8+
workflow_dispatch:
9+
inputs:
10+
logLevel:
11+
description: "Log level"
12+
required: true
13+
default: "warning"
14+
tags:
15+
description: "Test scenario tags"
16+
17+
jobs:
18+
sync:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v6
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Sync to CNB Repository
26+
run: |
27+
docker run --rm \
28+
-v ${{ github.workspace }}:${{ github.workspace }} \
29+
-w ${{ github.workspace }} \
30+
-e PLUGIN_TARGET_URL="https://cnb.cool/opsre/cloud_dns_exporter.git" \
31+
-e PLUGIN_AUTH_TYPE="https" \
32+
-e PLUGIN_USERNAME="cnb" \
33+
-e PLUGIN_PASSWORD=${{ secrets.CNB_TOKEN }} \
34+
-e PLUGIN_BRANCH="main" \
35+
-e PLUGIN_GIT_USER="cnb" \
36+
-e PLUGIN_GIT_EMAIL="cnb@cnb.cool" \
37+
-e PLUGIN_FORCE="true" \
38+
tencentcom/git-sync

docker-compose.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3'
21
services:
32
cloud_dns_exporter:
43
image: registry.cn-hangzhou.aliyuncs.com/eryajf/cloud_dns_exporter:latest
@@ -10,28 +9,29 @@ services:
109
target: /app/config.yaml
1110
environment:
1211
- TZ=Asia/Shanghai
13-
grafana:
14-
image: bitnami/grafana:11.2.0
15-
container_name: grafana
16-
environment:
17-
- GF_SECURITY_ADMIN_PASSWORD=admin #设置admin用户默认密码
18-
- TZ=Asia/Shanghai
19-
ports:
20-
- "3000:3000"
21-
volumes:
22-
- grafana_data:/opt/bitnami/grafana/data
23-
prometheus:
24-
image: bitnami/prometheus:2.54.1
25-
container_name: prometheus
26-
environment:
27-
- TZ=Asia/Shanghai
28-
ports:
29-
- "9090:9090"
30-
configs:
31-
- source: prometheus_config
32-
target: /opt/bitnami/prometheus/conf/prometheus.yml
33-
volumes:
34-
- prometheus_data:/opt/bitnami/prometheus/data
12+
# 以下为可选监控组件,如需使用请取消注释
13+
# grafana:
14+
# image: bitnami/grafana:11.2.0
15+
# container_name: grafana
16+
# environment:
17+
# - GF_SECURITY_ADMIN_PASSWORD=admin #设置admin用户默认密码
18+
# - TZ=Asia/Shanghai
19+
# ports:
20+
# - "3000:3000"
21+
# volumes:
22+
# - grafana_data:/opt/bitnami/grafana/data
23+
# prometheus:
24+
# image: bitnami/prometheus:2.54.1
25+
# container_name: prometheus
26+
# environment:
27+
# - TZ=Asia/Shanghai
28+
# ports:
29+
# - "9090:9090"
30+
# configs:
31+
# - source: prometheus_config
32+
# target: /opt/bitnami/prometheus/conf/prometheus.yml
33+
# volumes:
34+
# - prometheus_data:/opt/bitnami/prometheus/data
3535

3636
# 示例配置
3737
configs:

0 commit comments

Comments
 (0)