如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
gogit 可以将构建状态发送到不同的 Git 代码托管平台,例如:
export AI_PROVIDER=your-one-api-server-address
export ONEAPI_TOKEN=your-one-api-token
gogit commit
仅支持 https://github.com/songquanpeng/one-api%E3%80%82
理想情况下,gogit 可以在任何类型的 Git 仓库中检出分支或 PR。
你可以在 Git 仓库目录中运行以下命令:
gogit checkout --pr 1
以下是向私有 Gitlab 服务器发送构建状态的示例:
gogit status --provider gitlab \
--server http://10.121.218.82:6080 \
--repo yaml-readme \
--pr 1 \
--username linuxsuren \
--token h-zez9CWzyzykbLoS53s
也可用于以下场景:
以下是基于 Gitlab/GitHub 拉取请求的作者/审核者/被指派人发送钉钉通知的示例:
gogit pr --provider gitlab \
--server http://10.121.218.82:6080 \
--repo yaml-readme \
--pr 1 \
--username linuxsuren \
--token h-zez9CWzyzykbLoS53s \
--msg 'workflow done' \
--dingding-tokens linuxsuren=dingdingtoken
作为 Argo Workflow 执行器插件安装:
cat <<EOF | kubectl apply -f -
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: gogit-executor-plugin
namespace: default
---
apiVersion: v1
data:
sidecar.automountServiceAccountToken: "true"
sidecar.container: |
args:
- status
- --provider
- gitlab
- --target
- http://argo.argo-server.svc:2746 # 应为外部地址
- --create-comment=true # 创建评论以显示 Workflow 状态
image: ghcr.io/linuxsuren/workflow-executor-gogit:master
command:
- workflow-executor-gogit
name: gogit-executor-plugin
ports:
- containerPort: 3001
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 250m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: true
runAsNonRoot: true
runAsUser: 65534
kind: ConfigMap
metadata:
creationTimestamp: null
labels:
workflows.argoproj.io/configmap-type: ExecutorPlugin
name: gogit-executor-plugin
namespace: argo
EOF
然后,创建 WorkflowTemplate:
cat <<EOF | kubectl apply -f -
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: plugin
namespace: default
spec:
entrypoint: main
hooks:
exit:
template: status
all:
template: status
expression: "true"
templates:
- container:
args:
- search
- kubectl
command:
- hd
image: ghcr.io/linuxsuren/hd:v0.0.70
name: main
- name: status
plugin:
gogit-executor-plugin:
owner: linuxsuren
repo: test
pr: "3"
label: test
EOF
cat <<EOF | kubectl create -f -
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: plugin
namespace: default
spec:
workflowTemplateRef:
name: plugin
EOF
它可以在目标拉取请求上创建(并更新)评论,以显示 Workflow 的状态。示例如下:
hello-world 已成功。耗时 3m30.19239846s。请从 [此处](https://10.121.218.184:30298/workflows/default/hello-world-r2lqm) 查看日志输出。
| 阶段 | 状态 | 持续时间 |
|------------|------------|------------|
| test | Succeeded | 38s |
| scan | Succeeded | 54s |
| build | Succeeded | 2m54s |
| clone | Succeeded | 26s |
| check | Succeeded | 33s |
| build(0) | Succeeded | 2m44s |
来自 [gogit](https://github.com/linuxsuren/gogit) 的评论。
感谢以下开源项目,它们做了许多重要工作:
来自真实用户的反馈,见证轩辕镜像的优质服务