Skip to content

Commit ed815d4

Browse files
eryajferyajf
authored andcommitted
feat: 添加CNB平台相关配置文件和工作流
1 parent 04663da commit ed815d4

File tree

10 files changed

+107
-0
lines changed

10 files changed

+107
-0
lines changed

.cnb.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include:
2+
- .cnb/workflows/vscode.yml
3+
- .cnb/workflows/sync-to-github.yml

.cnb/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
custom:
2+
- https://ko-fi.com/eryajf
3+
- https://liberapay.com/eryajf
4+
- https://wiki.eryajf.net/reward/

.cnb/settings.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
workspace:
2+
launch:
3+
button:
4+
name: 🛫 起飞
5+
description: 💪 逐步迈向运维的四个现代化:规范化,标准化,高效化,优雅化
6+
hoverImage: .cnb/src/qifei.gif
7+
cpus: 8
8+
disabled: false
9+
autoOpenWebIDE: false
10+
11+
issue:
12+
button:
13+
description: 🙋🏻‍♀️ I Have A Question
14+
hoverImage: ".cnb/src/jushou.jpg"
15+
16+
fork:
17+
button:
18+
description: 🫵 年轻人,你很眼光
19+
hoverImage: ".cnb/src/trump.gif"

.cnb/src/jushou.jpg

5.7 KB
Loading

.cnb/src/qifei.gif

425 KB
Loading

.cnb/src/trump.gif

4.16 MB
Loading

.cnb/workflows/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
$:
2+
tag_push:
3+
- runner:
4+
cpus: 8
5+
services:
6+
- docker
7+
- git-clone-yyds
8+
stages:
9+
- name: 📦 构建制品
10+
image: docker.cnb.cool/znb/images/debian:all
11+
script: |
12+
sed -i 's@http://localhost:8888/@/@g' .env.production
13+
npm install --registry=http://registry.npmmirror.com
14+
yarn build:prod
15+
zip -q -r dist.zip dist
16+
openssl md5 dist.zip > dist.zip.md5
17+
- name: 🐋 推送制品
18+
image: cnbcool/attachments:latest
19+
settings:
20+
attachments:
21+
- dist.zip
22+
- dist.zip.md5

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
main:
2+
push:
3+
- runner:
4+
cpus: 8
5+
services:
6+
- docker
7+
- git-clone-yyds
8+
stages:
9+
- name: sync to github
10+
image: tencentcom/git-sync
11+
imports: https://cnb.cool/eryajf/build-env/-/blob/main/env.yaml
12+
settings:
13+
branch: main
14+
auth_type: https
15+
username: ${GIT_USERNAME}
16+
password: ${GIT_ACCESS_TOKEN}
17+
target_url: https://github.com/opsre/go-ldap-admin-ui.git
18+
git_email: 'github-actions[bot]@users.noreply.github.com'

.cnb/workflows/vscode.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$:
2+
vscode:
3+
- docker:
4+
image: docker.cnb.cool/znb/images/debian:all
5+
runner:
6+
cpus: 8
7+
services:
8+
- vscode
9+
- docker
10+
env:
11+
HISTFILE: "/root/.cnb/system/zsh_history"
12+
stages:
13+
- name: 🍉 🐷 🍉
14+
script: |
15+
ls -al

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Sync to CNB
2+
3+
on: [push]
4+
5+
jobs:
6+
sync:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
fetch-depth: 0
12+
13+
- name: Sync to CNB Repository
14+
run: |
15+
docker run --rm \
16+
-v ${{ github.workspace }}:${{ github.workspace }} \
17+
-w ${{ github.workspace }} \
18+
-e PLUGIN_TARGET_URL="https://cnb.cool/opsre/go-ldap-admin-ui.git" \
19+
-e PLUGIN_AUTH_TYPE="https" \
20+
-e PLUGIN_USERNAME="cnb" \
21+
-e PLUGIN_PASSWORD=${{ secrets.CNB_TOKEN }} \
22+
-e PLUGIN_BRANCH="main" \
23+
-e PLUGIN_GIT_USER="cnb" \
24+
-e PLUGIN_GIT_EMAIL="[email protected]" \
25+
-e PLUGIN_FORCE="true" \
26+
tencentcom/git-sync

0 commit comments

Comments
 (0)