Files
Deploy-Laboratory/ansible/files/05-04-gitlab-cicd/gitlab-ci-minimal.example.yml
jack 8c43761962 feat: 按 doc_id 重组 ansible/files 与验证框架
- ansible/files 改为与文档 XX-YY 对齐的目录结构,更新相关 playbook 路径
- 新增 scripts/verify.sh 与 ansible/playbooks/verify/*.yml,移除单体 verify-matrix.yml
- 补充 docs/00-02 矩阵状态、00-05 验证框架与流程、00-04 环境与 ylc65 工作机说明
- 增加 k3s 存储准备、Longhorn、local-path 等 playbook 与辅助脚本

Made-with: Cursor
2026-03-26 07:01:14 +08:00

22 lines
804 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# docs/05-04-k3s-配置gitlab-cicd.md — 最小 .gitlab-ci.yml 示例
stages: # CI 阶段定义(按顺序执行)
- lint # 代码/清单检查阶段
- deploy # 部署阶段
variables: # 全局变量
KUBECONFIG: "/builds/${CI_PROJECT_PATH}/kubeconfig" # Runner 内 kubeconfig 输出路径
lint: # 任务名lint
stage: lint # 归属 lint 阶段
script: # 执行脚本
- yamllint manifests || true # 允许 lint 失败不中断(示例用途)
deploy: # 任务名deploy
stage: deploy # 归属 deploy 阶段
script: # 执行脚本
- echo "$KUBE_CONFIG_CONTENT" > "$KUBECONFIG" # 将 CI 变量写入 kubeconfig 文件
- kubectl --kubeconfig="$KUBECONFIG" apply -f manifests/ # 应用 manifests
only: # 触发条件(旧语法)
- main # 仅 main 分支触发