From b6f46a07a0b3955c845a06991cb35d3992d441ea Mon Sep 17 00:00:00 2001 From: seekee421 Date: Fri, 6 Mar 2026 22:28:20 +0800 Subject: [PATCH] feat: launch official product site and one-click installers --- README.md | 72 ++++--- install/install.ps1 | 38 ++++ install/install.sh | 33 +++ site/index.html | 511 +++++++++++++++++++++++++++++++------------- 4 files changed, 472 insertions(+), 182 deletions(-) create mode 100644 install/install.ps1 create mode 100644 install/install.sh diff --git a/README.md b/README.md index 42ad0cd..ccc206c 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,59 @@ # DevOps Skills -面向 **Gitea Issue 驱动交付** 的技能仓库,内置 `gitea-issue-devops-agent`,支持: +Issue-Driven DevOps 平台技能仓库,核心产品是 `gitea-issue-devops-agent`。 -- 根据 issue 指定分支执行修复与提测 -- 分支级预览环境槽位分配与回收 -- 按变更范围智能部署(避免无意义重启服务端) -- 自动 / 半自动 / 全人工 三种协作模式 -- 图片类 issue 证据抓取与审阅 +它把交付流程固化为: -## 文档网页 +`Issue -> Branch -> Preview Slot -> Test Loop -> Human-Confirmed Merge` -- 站点文件:`site/index.html` -- 仓库内查看:`https://fun-md.com/Fun_MD/devops-skills/src/branch/main/site/index.html` -- 原始页面:`https://fun-md.com/Fun_MD/devops-skills/raw/branch/main/site/index.html` +## 公网产品页 + +- 产品官网:`https://fun-md.com/Fun_MD/devops-skills/raw/branch/main/site/index.html` +- 仓库入口:`https://fun-md.com/Fun_MD/devops-skills` + +## 一键安装 + +Linux: + +```bash +curl -fsSL https://fun-md.com/Fun_MD/devops-skills/raw/branch/main/install/install.sh | bash +``` + +macOS: + +```bash +curl -fsSL https://fun-md.com/Fun_MD/devops-skills/raw/branch/main/install/install.sh | bash +``` + +Windows (PowerShell): + +```powershell +powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr -useb https://fun-md.com/Fun_MD/devops-skills/raw/branch/main/install/install.ps1 | iex" +``` + +安装目标目录: + +- `~/.codex/skills/gitea-issue-devops-agent` ## 技能路径 - `skills/gitea-issue-devops-agent/SKILL.md` -## 安装 +## 核心能力 -```bash -git clone https://fun-md.com/Fun_MD/devops-skills.git -cd devops-skills -mkdir -p ~/.codex/skills -cp -r skills/gitea-issue-devops-agent ~/.codex/skills/ -``` - -Windows PowerShell: - -```powershell -git clone https://fun-md.com/Fun_MD/devops-skills.git -cd devops-skills -New-Item -ItemType Directory -Force $HOME\.codex\skills | Out-Null -Copy-Item .\skills\gitea-issue-devops-agent $HOME\.codex\skills\gitea-issue-devops-agent -Recurse -Force -``` +- 三种执行模式:`automatic` / `semi-automatic` / `manual` +- issue 图片证据抓取(含 attachments/assets 三路兜底) +- 按变更范围部署(`skip` / `client_only` / `server_only` / `full_stack` / `infra_only`) +- 预览槽位池分配与自动回收(TTL + 关闭释放) +- 最终代码合并必须人工确认 ## 核心脚本 - `skills/gitea-issue-devops-agent/scripts/issue_audit.py` - - issue 拉取、质量评分、去重、附件/图片抓取 - `skills/gitea-issue-devops-agent/scripts/change_scope.py` - - 识别 `skip/client_only/server_only/full_stack/infra_only` - `skills/gitea-issue-devops-agent/scripts/preview_slot_allocator.py` - - 分支预览槽位分配、复用、释放、TTL 回收 -## 工作流模板 - -仓库提供 `.gitea/workflows` 示例,可直接接入: +## .gitea/workflows 模板 - `.gitea/workflows/issue-branch-preview.yml` - `.gitea/workflows/preview-slot-reclaim.yml` - -用于实现“分配槽位 + 按变更范围部署 + 自动回收”。 diff --git a/install/install.ps1 b/install/install.ps1 new file mode 100644 index 0000000..69ea277 --- /dev/null +++ b/install/install.ps1 @@ -0,0 +1,38 @@ +param( + [string]$RepoUrl = "https://fun-md.com/Fun_MD/devops-skills.git", + [string]$CodexHome = "$HOME\.codex" +) + +$ErrorActionPreference = "Stop" + +$skillName = "gitea-issue-devops-agent" +$targetDir = Join-Path $CodexHome "skills\$skillName" +$tmpRoot = Join-Path $env:TEMP ("devops-skills-" + [Guid]::NewGuid().ToString("N")) + +try { + if (-not (Get-Command git -ErrorAction SilentlyContinue)) { + throw "[install] git is required but not found." + } + + Write-Host "[install] downloading $skillName from $RepoUrl" + git clone --depth 1 $RepoUrl $tmpRoot | Out-Null + + $sourceDir = Join-Path $tmpRoot "skills\$skillName" + if (-not (Test-Path $sourceDir)) { + throw "[install] skill directory not found in repository." + } + + New-Item -ItemType Directory -Force (Join-Path $CodexHome "skills") | Out-Null + if (Test-Path $targetDir) { + Remove-Item -Recurse -Force $targetDir + } + Copy-Item -Path $sourceDir -Destination $targetDir -Recurse -Force + + Write-Host "[install] done" + Write-Host "[install] installed path: $targetDir" +} +finally { + if (Test-Path $tmpRoot) { + Remove-Item -Recurse -Force $tmpRoot + } +} diff --git a/install/install.sh b/install/install.sh new file mode 100644 index 0000000..c22d7db --- /dev/null +++ b/install/install.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +set -euo pipefail + +REPO_URL="${REPO_URL:-https://fun-md.com/Fun_MD/devops-skills.git}" +SKILL_NAME="gitea-issue-devops-agent" +CODEX_HOME="${CODEX_HOME:-$HOME/.codex}" +TARGET_DIR="${CODEX_HOME}/skills/${SKILL_NAME}" +TMP_DIR="$(mktemp -d)" + +cleanup() { + rm -rf "$TMP_DIR" +} +trap cleanup EXIT + +if ! command -v git >/dev/null 2>&1; then + echo "[install] git is required but not found." + exit 1 +fi + +echo "[install] downloading ${SKILL_NAME} from ${REPO_URL}" +git clone --depth 1 "$REPO_URL" "$TMP_DIR/repo" >/dev/null 2>&1 + +if [ ! -d "$TMP_DIR/repo/skills/${SKILL_NAME}" ]; then + echo "[install] skill directory not found in repository." + exit 1 +fi + +mkdir -p "${CODEX_HOME}/skills" +rm -rf "$TARGET_DIR" +cp -R "$TMP_DIR/repo/skills/${SKILL_NAME}" "$TARGET_DIR" + +echo "[install] done" +echo "[install] installed path: ${TARGET_DIR}" diff --git a/site/index.html b/site/index.html index f3f543f..7f0f78a 100644 --- a/site/index.html +++ b/site/index.html @@ -3,202 +3,417 @@ - Gitea Issue DevOps Agent + Issue-Driven DevOps Agent | Branch-Scoped Delivery Platform -
+
+ +
-

Gitea Issue DevOps Agent

+

把 Issue 变成可追踪、可复用、可规模化的交付流水线

- 一个把 Issue → Branch → Preview Env → 测试闭环 固化到技能与脚本中的交付方案。 - 核心目标是提升交付速度,同时避免“每个分支都全量起服务”的资源浪费。 + 我们不是“会修 bug 的脚本”,而是一个面向真实研发组织的 DevOps 交付平台: + Issue → Branch → Preview Slot → 提测闭环,并且始终保留工程师对最终合并的控制权。

-
- 自动 / 半自动 / 全人工 - Issue 图片证据抓取 - 变更范围智能部署 - 槽位池自动回收 + +
+
3
执行模式(自动/半自动/人工)
+
5
部署范围策略(skip→full_stack)
+
1:1
Issue/Branch/Preview Slot 绑定
+
24h+
可配置 TTL 自动回收
-
+

核心价值

-
+
-

1. 分支隔离提测

-

每个 issue 绑定分支与预览槽位,主干环境保持稳定,避免相互覆盖。

+

分支隔离,主干稳定

+

每个 issue 分配独立分支和预览槽位,不再发生“提测相互覆盖”,主干环境用于稳定回归。

-

2. 资源按需分配

-

根据变更范围判断 client_only/server_only/full_stack,不变更服务端就不重启服务端。

+

资源智能节流

+

根据代码变更范围自动判定部署策略。仅前端改动时不重启服务端,直接复用共享后端。

-

3. 可审计闭环

-

每次提测都可回溯到 commit、测试结果、环境 URL、验证步骤,且合并始终由工程师人工确认。

+

证据驱动闭环

+

自动沉淀 commit、测试结果、环境链接、验证步骤。Issue 可关闭、可回溯、可审计。

+
+
+

这是一套用于长期演进的研发基础设施,不是临时脚本集合。

+
+ +
+

工作流拓扑

+
+
1. 引导连接

输入 repo_url、api_key、mode,完成连通性校验。

+
2. 质量审计

拉取 issue 与图片附件,做质量评分与去重分组。

+
3. 分支执行

严格在 issue 指定分支改动,保留变更可追踪性。

+
4. 按范围部署

change_scope 自动判断 skip/client/server/full_stack。

+
5. 自动回收

槽位 TTL + 关闭释放,减少预览环境资源占用。

+
+
    +
  • 工作流模板:.gitea/workflows/issue-branch-preview.yml
  • +
  • 回收模板:.gitea/workflows/preview-slot-reclaim.yml
  • +
  • 合并策略:所有模式下都要求工程师人工确认最终合并
  • +
+
+ +
+

一键安装(Windows / macOS / Linux)

+

以下命令会把技能安装到本机 ~/.codex/skills/gitea-issue-devops-agent

+
+
+

Linux

+
curl -fsSL https://fun-md.com/Fun_MD/devops-skills/raw/branch/main/install/install.sh | bash
+ +
+
+

macOS

+
curl -fsSL https://fun-md.com/Fun_MD/devops-skills/raw/branch/main/install/install.sh | bash
+ +
+
+

Windows (PowerShell)

+
powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr -useb https://fun-md.com/Fun_MD/devops-skills/raw/branch/main/install/install.ps1 | iex"
+
-
-

安装指南

-

1) 获取技能仓库

-
git clone https://fun-md.com/Fun_MD/devops-skills.git
-cd devops-skills
-

2) 安装到 Codex skills

-
# Linux / macOS
-mkdir -p ~/.codex/skills
-cp -r skills/gitea-issue-devops-agent ~/.codex/skills/
-
-# Windows PowerShell
-New-Item -ItemType Directory -Force $HOME\.codex\skills | Out-Null
-Copy-Item .\skills\gitea-issue-devops-agent $HOME\.codex\skills\gitea-issue-devops-agent -Recurse -Force
-

3) 首次引导参数

-
    -
  • repo_url(仓库地址)
  • -
  • api_key(具备 issue 读写权限)
  • -
  • modeautomatic / semi-automatic / manual
  • -
  • 可选:reviewerstest_entrydeploy_envhealth_endpointmin_quality_score
  • -
+
+

核心工具

+
+
+

issue_audit.py

+

抓取 issue、评论和图片附件,完成质量评分、去重与回归候选识别。

+
python skills/gitea-issue-devops-agent/scripts/issue_audit.py --base-url https://fun-md.com --repo FunMD/document-collab --token <TOKEN> --state all --download-attachments --output-dir .tmp/issue-audit
+
+
+

change_scope.py

+

输出部署范围建议,决定是否需要服务端重启。

+
python skills/gitea-issue-devops-agent/scripts/change_scope.py --repo-path . --base-ref origin/main --head-ref HEAD
+
+
+

preview_slot_allocator.py

+

管理 preview 槽位:分配、复用、释放、TTL 回收。

+
python skills/gitea-issue-devops-agent/scripts/preview_slot_allocator.py --state-file .tmp/preview-slots.json --slots preview-a,preview-b --repo FunMD/document-collab --issue 48 --branch dev --ttl-hours 24 --url-template https://{slot}.qa.example.com --evict-oldest
+
+
-
-

工具使用说明

-

issue_audit.py(拉取 issue + 图片证据)

-
python skills/gitea-issue-devops-agent/scripts/issue_audit.py \
-  --base-url https://fun-md.com \
-  --repo FunMD/document-collab \
-  --token <GITEA_TOKEN> \
-  --state all \
-  --download-attachments \
-  --output-dir .tmp/issue-audit
- -

change_scope.py(按改动范围决策部署)

-
python skills/gitea-issue-devops-agent/scripts/change_scope.py \
-  --repo-path . \
-  --base-ref origin/main \
-  --head-ref HEAD
- -

preview_slot_allocator.py(分配 / 复用 / 释放槽位)

-
python skills/gitea-issue-devops-agent/scripts/preview_slot_allocator.py \
-  --state-file .tmp/preview-slots.json \
-  --slots preview-a,preview-b \
-  --repo FunMD/document-collab \
-  --issue 48 \
-  --branch dev \
-  --ttl-hours 24 \
-  --url-template https://{slot}.qa.example.com \
-  --evict-oldest
-
- -
-

.gitea/workflows 接入

-

- 本仓库已包含示例工作流:.gitea/workflows/issue-branch-preview.yml 与 - .gitea/workflows/preview-slot-reclaim.yml,用于完成以下自动化链路: -

-
    -
  • push 到 issue 分支后:自动分配槽位 + 变更范围识别 + 选择性部署
  • -
  • issue 关闭 / 定时任务:自动释放或回收过期槽位
  • -
-

建议先在测试仓库验证工作流变量后再推广到生产仓库。

-
- -
- Skill Path -

skills/gitea-issue-devops-agent/SKILL.md

-
+
+ +