Compare commits

...

11 Commits

Author SHA1 Message Date
b66ed8241c test: 提交即构建最终验证 (2026-11-29 17:12:55) 2026-11-29 17:12:55 +08:00
dc489d92df test: 每分钟轮询验证 (2026-11-29 17:08:45) 2026-11-29 17:08:46 +08:00
2f422f8250 test: 验证提交自动触发构建 (2026-11-29 16:54:26) 2026-11-29 16:54:27 +08:00
肖忆
d629232461 测试02 2026-11-29 16:33:53 +08:00
f67e04aafa ci: 改用 curl 调 K8s API 部署 2026-11-29 16:25:03 +08:00
72fc7a2469 ci: 部署到 K8s stage 2026-11-29 15:44:14 +08:00
肖忆
e056630a2f 测试01 2026-11-29 15:33:37 +08:00
0bd4b7e36b ci: 增加部署到 K8s 的 stage 2026-11-29 15:20:36 +08:00
肖忆
6e73c29704 测试 2026-11-28 16:56:41 +08:00
肖忆
416be2bb50 Merge branch 'main' of http://192.168.8.11:30003/admin/demo-app 2026-11-28 16:35:05 +08:00
肖忆
34ad3e24a6 测试001 2026-11-28 16:35:00 +08:00
3 changed files with 22 additions and 0 deletions

18
Jenkinsfile vendored
View File

@@ -42,5 +42,23 @@ pipeline {
} }
} }
} }
stage('部署到 K8s') {
steps {
sh '''
set -e
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
API=https://kubernetes.default.svc
CA=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
IMAGE="$HARBOR/$PROJECT/$IMAGE_NAME:$IMAGE_TAG"
BODY=$(printf '{"spec":{"template":{"spec":{"containers":[{"name":"demo-app","image":"%s"}]}}}}' "$IMAGE")
curl -s --cacert "$CA" -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/strategic-merge-patch+json" \
-X PATCH -d "$BODY" \
"$API/apis/apps/v1/namespaces/demo/deployments/demo-app"
echo
echo "已部署镜像: $IMAGE"
'''
}
}
} }
} }

2
ci-trigger-test.txt Normal file
View File

@@ -0,0 +1,2 @@
自动触发测试最终验证
提交时间: 2026-11-29 17:12:55

View File

@@ -1,2 +1,4 @@
<h1>Auto Build Test</h1> <h1>Auto Build Test</h1>
<!-- auto 1795850692 --> <!-- auto 1795850692 -->
<p>当前时间:{{ now }}</p>
<p>测试02</p>