Compare commits

...

131 Commits

Author SHA1 Message Date
bamanker
472edfaabd 修改了dockerfile中的基础镜像
Some checks failed
Build Push and Deploy Image / build (push) Failing after 23m17s
2026-01-04 10:55:40 +08:00
bamanker
e8ac7f9fbc 修改了安装docker方法13
Some checks failed
Build Push and Deploy Image / build (push) Failing after 20m56s
2026-01-03 22:59:52 +08:00
bamanker
cb418d8acd 修改了安装docker方法12
Some checks failed
Build Push and Deploy Image / build (push) Failing after 21m9s
2026-01-03 22:33:39 +08:00
bamanker
d4d6064bcd 修改了安装docker方法12
Some checks failed
Build Push and Deploy Image / build (push) Failing after 20m59s
2026-01-02 15:22:06 +08:00
bamanker
297ce02549 修改了安装docker方法11
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2026-01-02 00:10:40 +08:00
bamanker
4f7cfe396a 修改了安装docker方法10
Some checks failed
Build Push and Deploy Image / build (push) Failing after 21m14s
2026-01-01 23:43:45 +08:00
bamanker
521ac4d3f6 修改了安装docker方法9
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2026-01-01 22:55:47 +08:00
bamanker
095245b421 修改了安装docker方法8
Some checks failed
Build Push and Deploy Image / build (push) Failing after 20m11s
2026-01-01 16:46:08 +08:00
bamanker
af390af277 修改了安装docker方法7
Some checks failed
Build Push and Deploy Image / build (push) Failing after 35m12s
2026-01-01 10:39:29 +08:00
bamanker
3e55783c5f 修改了安装docker方法6
Some checks failed
Build Push and Deploy Image / build (push) Failing after 22m22s
2026-01-01 09:51:58 +08:00
bamanker
b2fba3cac7 修改了安装docker方法5
Some checks failed
Build Push and Deploy Image / build (push) Failing after 29m20s
2025-12-31 23:46:55 +08:00
bamanker
26f6647a4d 修改了安装docker方法4
Some checks failed
Build Push and Deploy Image / build (push) Failing after 20m58s
2025-12-31 22:48:42 +08:00
bamanker
84b6f139b9 修改了安装docker方法3
Some checks failed
Build Push and Deploy Image / build (push) Failing after 21m58s
2025-12-31 10:56:07 +08:00
bamanker
5e865ab425 修改了安装docker方法2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m17s
2025-12-31 10:53:49 +08:00
bamanker
6b4c1b6676 修改了安装docker方法1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m32s
2025-12-31 10:50:24 +08:00
bamanker
ff654bb606 修改了安装docker方法
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m39s
2025-12-31 10:47:45 +08:00
bamanker
8eaa9fd792 修改安装的docker命令3
Some checks failed
Build Push and Deploy Image / build (push) Failing after 56s
2025-12-31 10:24:14 +08:00
bamanker
c7af2dd52c 修改安装的docker命令2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 55s
2025-12-31 10:22:23 +08:00
bamanker
373b497d37 修改安装的docker命令1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 16s
2025-12-31 10:20:57 +08:00
bamanker
6d1dc22670 修改安装的docker命令
Some checks failed
Build Push and Deploy Image / build (push) Failing after 58s
2025-12-31 10:13:34 +08:00
bamanker
52e4616bb3 安装 tee 命令3 切换ubuntu版本
Some checks failed
Build Push and Deploy Image / build (push) Failing after 4m55s
2025-12-31 10:03:35 +08:00
bamanker
79fba8746f 安装 tee 命令2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m4s
2025-12-31 09:52:58 +08:00
bamanker
80122ebe57 安装 tee 命令1 2025-12-31 09:50:30 +08:00
bamanker
148672031f 安装 tee 命令
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m0s
2025-12-31 09:39:38 +08:00
bamanker
fdcc48178f Merge remote-tracking branch 'origin/runson-image' into runson-image
Some checks failed
Build Push and Deploy Image / build (push) Failing after 57s
2025-12-31 09:32:18 +08:00
bamanker
1f9029baf1 修改安装docker命令,切换为国内源
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-31 09:31:28 +08:00
bamanker
df57e63c3e 修改安装docker命令,切换为国内源
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m28s
2025-12-31 09:30:32 +08:00
bamanker
d6b67b428b 修改安装docker命令
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m33s
2025-12-31 09:24:50 +08:00
bamanker
f3eeaf48fd 修改docker命令
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-31 09:14:14 +08:00
bamanker
46f1b7ca22 手动输入命令构建docker镜像并上传1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 19m45s
2025-12-31 01:08:50 +08:00
bamanker
c7d1bedf79 手动输入命令构建docker镜像并上传
Some checks failed
Build Push and Deploy Image / build (push) Failing after 20m0s
2025-12-31 00:40:55 +08:00
bamanker
8dc0e1f9d7 修改一些内容2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 19m44s
2025-12-31 00:15:39 +08:00
bamanker
5cb44e596c 修改一些内容1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 7m17s
2025-12-30 23:03:37 +08:00
bamanker
2f9ff5f9c9 修改一些内容
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-30 23:02:05 +08:00
bamanker
cfbd38a09d Merge branch 'graalvm' into runson-image
# Conflicts:
#	.gitea/workflows/build.yml
2025-12-30 18:00:37 +08:00
bamanker
93a1aa6465 add action docker buildx
Some checks failed
Build Push and Deploy Image / build (push) Failing after 7m39s
2025-12-30 17:52:26 +08:00
bamanker
6adc7bc789 fix bugs
Some checks failed
Build Push and Deploy Image / build (push) Failing after 19m36s
2025-12-30 17:15:17 +08:00
bamanker
899beb46ff 增加docker依赖
Some checks failed
Build Push and Deploy Image / build (push) Failing after 7s
2025-12-30 17:13:49 +08:00
bamanker
d78dd16a8d 增加maven依赖
Some checks failed
Build Push and Deploy Image / build (push) Failing after 22m48s
2025-12-30 16:44:45 +08:00
bamanker
cefc01220d 修改action graalvm
Some checks failed
Build Push and Deploy Image / build (push) Failing after 5m34s
2025-12-30 16:12:28 +08:00
bamanker
a9a18c13b6 修改action 版本
Some checks failed
Build Push and Deploy Image / build (push) Failing after 7m0s
2025-12-30 15:55:50 +08:00
bamanker
b0e021e0a0 修改node24镜像
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m6s
2025-12-30 15:45:53 +08:00
bamanker
58ecbced00 action checkout 修改为v4
Some checks failed
Build Push and Deploy Image / build (push) Failing after 2m21s
2025-12-30 15:37:39 +08:00
bamanker
d0457dc910 fix some bug 1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m29s
2025-12-30 15:28:44 +08:00
bamanker
8359c9c4dd fix some bug
Some checks failed
Build Push and Deploy Image / build (push) Failing after 11s
2025-12-30 15:04:03 +08:00
bamanker
ac8aacbd63 修改了找不到命令的问题 6
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m10s
2025-12-30 14:15:52 +08:00
bamanker
969002ab42 修改了找不到命令的问题
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-30 13:17:22 +08:00
bamanker
1e1f1526fc 修改了runs on 镜像为ubuntu 5
Some checks failed
Build Push and Deploy Image / build (push) Failing after 8s
2025-12-30 13:15:31 +08:00
bamanker
e381ac36e1 修改了runs on 镜像为ubuntu 4
Some checks failed
Build Push and Deploy Image / build (push) Failing after 5m24s
2025-12-30 12:49:13 +08:00
bamanker
009f6ae5b7 修改了runs on 镜像为ubuntu 2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 3s
2025-12-30 12:32:40 +08:00
bamanker
ea2d7d76af 修改了runs on 镜像为ubuntu 1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 5s
2025-12-30 12:27:47 +08:00
bamanker
5dbb383d07 修改了runs on 镜像为ubuntu
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-30 12:25:06 +08:00
bamanker
699d6cc5c3 修改了runs on 镜像为ubuntu:jammy
Some checks failed
Build Push and Deploy Image / build (push) Failing after 36s
2025-12-30 12:04:00 +08:00
bamanker
499c3058fe 修改了runs on 镜像为node:22-alpine
Some checks failed
Build Push and Deploy Image / build (push) Failing after 55s
2025-12-30 11:32:54 +08:00
bamanker
057cb5de38 本地build fix3
Some checks failed
Build Push and Deploy Image / build (push) Failing after 22m31s
2025-12-30 10:40:41 +08:00
bamanker
bf1f52ad54 本地build fix2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 17s
2025-12-30 10:33:08 +08:00
bamanker
1696261450 本地build fix1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 19s
2025-12-30 10:28:31 +08:00
bamanker
5ca35df955 本地build
Some checks failed
Build Push and Deploy Image / build (push) Failing after 21s
2025-12-30 10:06:49 +08:00
bamanker
21bc585376 修改了deploy参数 2025-12-29 22:58:14 +08:00
bamanker
00684cebf2 修改了runs-on镜像
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-29 21:45:52 +08:00
bamanker
a29c9c1085 修改了一些问题
Some checks failed
Build Push and Deploy Image / build (push) Failing after 24m59s
2025-12-29 17:43:49 +08:00
bamanker
838e811619 修改了无法找到node的问题
Some checks failed
Build Push and Deploy Image / build (push) Failing after 4m48s
2025-12-29 17:23:04 +08:00
bamanker
e02119c1f3 action环境切换到ubuntu镜像
Some checks failed
Build Push and Deploy Image / build (push) Failing after 7m56s
2025-12-29 16:34:10 +08:00
bamanker
dfe90c96b2 fix build文件
Some checks failed
Build Push and Deploy Image / build (push) Failing after 14s
2025-12-28 22:47:18 +08:00
bamanker
785488505a graalvm native 原生镜像版本
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-28 22:43:17 +08:00
bamanker
078fdf969e fix readinessProbe http path
All checks were successful
Build Push and Deploy Image / build (push) Successful in 4m35s
2025-12-28 17:08:44 +08:00
bamanker
e428f7a05c fix 2025-12-26 17:49:55 +08:00
bamanker
d694d0f7ab 修复端口号错误
Some checks failed
Build Push and Deploy Image / build (push) Failing after 36s
2025-12-26 17:07:01 +08:00
bamanker
2cc70877a0 直接用本地kubectl
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m7s
2025-12-26 17:04:07 +08:00
bamanker
44c6fab1f4 更换kubectl action,修复了bug3
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m17s
2025-12-26 16:37:45 +08:00
bamanker
cf924d1ee7 更换kubectl action,修复了bug1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 47s
2025-12-26 16:04:13 +08:00
bamanker
d97d39e5c4 更换kubectl action,修复了bug
Some checks failed
Build Push and Deploy Image / build (push) Failing after 30s
2025-12-26 15:51:23 +08:00
bamanker
55f57f9085 更换kubectl action
All checks were successful
Build Push and Deploy Image / build (push) Successful in 2m7s
2025-12-26 15:42:05 +08:00
bamanker
0389942e4f debug22
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 15:00:39 +08:00
bamanker
bc853144b8 debug21
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 14:57:57 +08:00
bamanker
f5b1de075f add 显示注入后的deployment文件
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m14s
2025-12-26 12:50:09 +08:00
bamanker
24df5cd7d6 修复了一个小问题
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 12:45:45 +08:00
bamanker
6ed61c6501 修复传递环境变量不成功的问题1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 13s
2025-12-26 12:43:23 +08:00
bamanker
f677828aae 修复传递环境变量不成功的问题
Some checks failed
Build Push and Deploy Image / build (push) Failing after 14s
2025-12-26 12:19:43 +08:00
bamanker
29f1bc8aa1 传递环境变量20
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 12:00:41 +08:00
bamanker
a83edb9479 传递环境变量19
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 11:15:39 +08:00
bamanker
2bf5e16dcd 传递环境变量18
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 11:12:02 +08:00
bamanker
d726553254 传递环境变量17
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 11:03:07 +08:00
bamanker
a66c3341d8 传递环境变量16 2025-12-26 11:01:51 +08:00
bamanker
ade040c622 传递环境变量15
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 10:57:34 +08:00
bamanker
9384be3d8a 传递环境变量14
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 10:47:13 +08:00
bamanker
cb0355b2d3 传递环境变量13
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 10:45:29 +08:00
bamanker
a59bf54e56 传递环境变量12
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 10:20:13 +08:00
bamanker
a82e7e9c26 传递环境变量11
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 10:03:49 +08:00
bamanker
1e81261aef 传递环境变量10
Some checks failed
Build Push and Deploy Image / build (push) Failing after 2s
2025-12-26 10:02:07 +08:00
bamanker
c0975a75ed 传递环境变量9
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 09:57:51 +08:00
bamanker
10153898c2 传递环境变量8
Some checks failed
Build Push and Deploy Image / build (push) Failing after 2s
2025-12-26 09:56:48 +08:00
bamanker
8412554d26 传递环境变量7
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 09:51:14 +08:00
bamanker
8555ea3077 传递环境变量6
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1s
2025-12-26 09:50:18 +08:00
bamanker
79471c11a5 传递环境变量5
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1s
2025-12-26 09:46:29 +08:00
bamanker
11c1c2fa23 传递环境变量4 2025-12-26 09:43:54 +08:00
bamanker
90e4fb4e96 传递环境变量3 2025-12-26 09:42:31 +08:00
bamanker
3dab5fc361 传递环境变量2 2025-12-26 09:38:54 +08:00
bamanker
a2cea3ca9a 传递环境变量1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 2s
2025-12-26 09:36:22 +08:00
bamanker
b37172331e 传递环境变量
Some checks failed
Build Push and Deploy Image / build (push) Failing after 6s
2025-12-26 09:31:29 +08:00
bamanker
6d9fba8ea8 环境变量传递
Some checks failed
Build Push and Deploy Image / build (push) Failing after 4s
2025-12-25 23:57:33 +08:00
bamanker
77a1f50115 完善了一些内容
Some checks failed
Build Push and Deploy Image / build (push) Failing after 3m59s
2025-12-25 17:43:30 +08:00
bamanker
1f7d5eb904 修改了deployment里的错别字 2025-12-25 17:42:28 +08:00
bamanker
9f4028e439 修改了deployment里的错别字
All checks were successful
Build Push and Deploy Image / build (push) Successful in 1m27s
2025-12-25 17:29:22 +08:00
bamanker
b7085d2765 修改了apply url的格式,以便访问原始文件代码
All checks were successful
Build Push and Deploy Image / build (push) Successful in 1m12s
2025-12-25 17:23:58 +08:00
bamanker
d2d3e9e3f5 修改deployment.yml文件格式,防止json转换错误1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m29s
2025-12-25 17:01:00 +08:00
bamanker
95edbd85aa 修改deployment.yml文件格式,防止json转换错误
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m6s
2025-12-25 16:45:48 +08:00
bamanker
255baf2f3d 修改deployment.yml文件格式 2025-12-25 16:42:03 +08:00
bamanker
713a47c337 修改deployment.yml文件格式 2025-12-25 16:42:03 +08:00
bamanker
044ddf9ef1 远程k3s可以连接,测试apply指令-修改参数格式5
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-25 16:25:26 +08:00
bamanker
7d057843be Merge remote-tracking branch 'origin/master' into HEAD
# Conflicts:
#	.gitea/workflows/build.yml
2025-12-25 16:20:58 +08:00
bamanker
d837507f10 远程k3s可以连接,测试apply指令-修改参数格式4
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m16s
2025-12-25 16:19:03 +08:00
bamanker
9dd0d38cf8 远程k3s可以连接,测试apply指令-修改参数格式3
Some checks failed
Build Push and Deploy Image / build (push) Failing after 24s
2025-12-25 15:37:56 +08:00
bamanker
647ee0937e 远程k3s可以连接,测试apply指令-修改参数格式2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 2m12s
2025-12-25 15:15:59 +08:00
bamanker
2444817f63 远程k3s可以连接,测试apply指令-修改参数格式
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m2s
2025-12-25 15:08:03 +08:00
bamanker
6e0fe5d06b 远程k3s可以连接,测试apply指令-修改deploy文件路径1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 24s
2025-12-25 15:03:25 +08:00
bamanker
38e753b473 远程k3s可以连接,测试apply指令-修改deploy文件路径
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m18s
2025-12-25 14:41:21 +08:00
bamanker
89f4565cd7 远程k3s可以连接,测试apply指令-5
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m23s
2025-12-25 14:36:51 +08:00
bamanker
2da2f058ca 远程k3s可以连接,测试apply指令-4
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m21s
2025-12-25 14:33:24 +08:00
bamanker
af34178bf5 远程k3s可以连接,测试apply指令-3
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m29s
2025-12-25 13:19:54 +08:00
bamanker
355372126f 远程k3s可以连接,测试apply指令-2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m45s
2025-12-25 13:08:01 +08:00
bamanker
829c7b569b 远程k3s可以连接,测试apply指令-1
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-25 11:53:52 +08:00
bamanker
272b36d656 debug473
All checks were successful
Build Push and Deploy Image / build (push) Successful in 1m25s
2025-12-25 11:50:11 +08:00
bamanker
80341eb16c debug47
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m46s
2025-12-25 11:36:10 +08:00
bamanker
366c38401e debug4
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m13s
2025-12-25 11:27:04 +08:00
bamanker
b09e99e348 debug3
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m43s
2025-12-25 11:14:37 +08:00
bamanker
644d75b828 debug2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 0s
2025-12-25 11:09:50 +08:00
bamanker
9136396673 debug
All checks were successful
Build Push and Deploy Image / build (push) Successful in 26s
2025-12-25 10:34:20 +08:00
bamanker
d1a8a63579 修改了deployment.yml文件111
Some checks failed
Build Push and Deploy Image / build (push) Failing after 21s
2025-12-25 10:17:25 +08:00
bamanker
5afbb5e642 修改了deployment.yml文件11
All checks were successful
Build Push and Deploy Image / build (push) Successful in 23s
2025-12-25 10:14:04 +08:00
bamanker
dbf588a8d1 修改了deployment.yml文件1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 48s
2025-12-25 10:05:56 +08:00
5 changed files with 224 additions and 137 deletions

View File

@@ -1,79 +0,0 @@
---
## k8s默认是访问不了外部服务的需要代理,以mysql和redis为例代理myservice名称到192.168.0.100配置文件中对应的ip修改为myservice
#apiVersion: v1
#kind: Endpoints
#metadata:
# name: myservice
#subsets:
# - addresses:
# - ip: 192.168.0.100
# ports:
# - port: 6379
# protocol: TCP
# name: redis
# - port: 3306
# protocol: TCP
# name: mysql
#---
#apiVersion: v1
#kind: Service
#metadata:
# name: myservice
#spec:
# ports:
# - port: 6379
# targetPort: 6379
# protocol: TCP
# name: redis
# - port: 3306
# targetPort: 3306
# protocol: TCP
# name: mysql
#
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: myk3sTest
spec:
replicas: 2
revisionHistoryLimit: 3
selector:
matchLabels:
app: myk3sTest
template:
metadata:
labels:
app: myk3sTest
spec:
containers:
- image: ${env.REGISTRY}/${env.IMAGE_NAME}:${steps.datetime.outputs.datetime}
name: myk3sTest
imagePullPolicy: Always
readinessProbe:
httpGet:
path: /actuator/health
port: 9090
initialDelaySeconds: 1
successThreshold: 5
ports:
- containerPort: 9090
imagePullSecrets:
- name: dockerhub-id
---
apiVersion: v1
kind: Service
metadata:
name: myk3sTest
spec:
type: NodePort
externalTrafficPolicy: Local
ports:
- name: http-8080
protocol: TCP
port: 9090
nodePort: 30099
selector:
app: myk3sTest

View File

@@ -10,41 +10,90 @@ on:
# - main
workflow_dispatch: #手动构建h
#设置全局环境变量
env:
PATH: /opt/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
REGISTRY: registry.cn-chengdu.aliyuncs.com
IMAGE_NAME: bamanker/myk3stest
CONTAINER_NAME: myk3stest
REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
IMAGE_NAMESPACE: bamanker # todo 可以通过读取pom文件获取下面这些属性值
IMAGE_NAME: myk3stest
APP_NAME: myk3s-test
# 构建 Job
jobs:
# 构建 Job
build:
runs-on: host
outputs: # 声明作业的输出变量,方便在其他 Job 引用
datetime: ${{ steps.datetime.outputs.datetime }}
runs-on: ubuntu-node22 # 如果host构建 linux_amd64
# container:
# image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/ghcr.io/catthehacker/ubuntu:act-latest
steps:
# 下载仓库源码依赖java环境因此构建服务器本地需要下载安装java并设置环境变量
- name: Checkout repository code
uses: http://139.9.216.111:3000/bamanker/checkout@v6
# - name: Set up Java
# uses: https://gitee.com/bamanker/setup-java@v5
- name: Print system info 1
run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
- name: Print system info 2
run: echo " This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- name: Print system info 3
run: echo " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Print env
run: env
- name: Install dependencies
run: |
apt-get update &&
apt-get install -y gettext &&
apt-get install -y maven &&
apt-get install -y sudo &&
apt-get install -y iptables
- name: Set up Docker
uses: http://139.9.216.111:3000/bamanker/setup-docker-action@v4
- name: Generate maven config
uses: http://139.9.216.111:3000/bamanker/maven-settings-action@v3.1.0
with:
mirrors: '[{"id": "alimaven", "name": "aliyun maven", "mirrorOf": "central", "url": "http://maven.aliyun.com/nexus/content/groups/public/"}]'
# - uses: http://localhost:3000/bamanker/setup-node@v6
# with:
# java-version: '25.0.1'
# distribution: 'openjdk'
# cache: 'maven'
#检查java版本
# node-version: 24
# cache: 'npm'
# - run: node -v
# 下载仓库源码依赖node环境因此构建服务器本地需要下载安装node并设置环境变量
# - name: Set up Docker Buildx
# uses: http://139.9.216.111:3000/bamanker/setup-buildx-action@v3
- name: Checkout repository code
#使用自定义仓库action
uses: http://139.9.216.111:3000/bamanker/checkout@v4
# 获取 TAG 并设置为环境变量
- name: Get version
id: get_version
# e.g. refs/tags/v1.0.0
run: |
echo "version=${GITHUB_REF/refs\/tags\/v}" >> $GITHUB_OUTPUT
- name: Check java version
run: java -version
- name: Show now path
run: echo $(pwd)
echo "APP_TAG=${GITHUB_REF/refs\/tags\/v}" >> $GITHUB_ENV
# 检查 TAG 并传参
- name: Set envVar
id: set_envar
run: |
echo "The app version is $APP_TAG" && echo "tag=$APP_TAG" >> $GITHUB_OUTPUT &&
echo "now workspace: ${{ github.workspace }}" &&
docker version &&
docker --help
# 为其他配置文件注入环境变量
- name: Inject envVar
run: |
envsubst < ./deployment-temp.yml > ./deployment.yml &&
cat ./deployment.yml
# 构建java项目
- name: Set up Java
uses: http://139.9.216.111:3000/bamanker/setup-graalvm@v1
with:
distribution: 'graalvm'
java-version: '25.0.1'
cache: 'maven'
- name: Build with Maven
# 设置Maven执行权限使用maven绝对路径执行打包命令
run: /usr/local/maven/bin/mvn clean package -DskipTests -Pprod
#使用maven绝对路径执行打包命令
run: mvn clean native:compile -DskipTests -Pnative
# 登录镜像仓库,方便后续上传镜像
- name: Login to Docker Registry
@@ -55,35 +104,43 @@ jobs:
# 这里也可以通过 secrets 传入,后面再介绍
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# 获取时间戳
- name: Get datetime
id: datetime
run: |
echo "datetime=$(date '+%Y-%m-%d-%H-%M-%S')" >> $GITHUB_OUTPUT
# # 获取时间戳
# - name: Get datetime
# id: datetime
# run: |
# echo "datetime=$(date '+%Y-%m-%d-%H-%M-%S')" >> $GITHUB_OUTPUT
# 构建并上传镜像
# 构建并上传镜像 TODO 直接用docker命令操作
- name: Build and push Docker image
uses: http://139.9.216.111:3000/bamanker/build-push-action@v6 # 获取上一步截取到的版本号,既 1.0.0
# uses: http://139.9.216.111:3000/bamanker/build-push-action@v4 # 获取上一步截取到的版本号,既 1.0.0
#只能这样接收
env:
TAG: ${{ steps.get_version.outputs.version }}
with:
context: .
platforms: linux/amd64
file: Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
TAG: ${{ steps.set_envar.outputs.tag }}
run: |
ls &&
docker build --file Dockerfile --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} --push . &&
docker image ls
# ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} --push.
# uses: http://139.9.216.111:3000/bamanker/docker-build-push@v5
# with:
# context: .
## platforms: linux/amd64
# file: Dockerfile
# push: true
# tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
- name: k8s Check and Apply New Deployment
uses: http://139.9.216.111:3000/bamanker/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
#发布到 k8s
- name: Generate kubeconfig
uses: http://139.9.216.111:3000/bamanker/kubectl-action@v1.4.0
with:
args: apply -f http://${{ secrets.DEVOPS_GITEA_TOKEN }}@/139.9.216.111:3000/bamanker/myk3sTest/src/branch/master/.deploy/deployment.yml
base64-kube-config: ${{ secrets.KUBE_CONFIG }}
- name: Deploy k8s
run: kubectl apply -f ./deployment.yml
# command: apply -f http://139.9.216.111:3000/bamanker/myk3sTest/raw/branch/master/.deploy/deployment-temp.yml
- name: k8s Check Pods Health
run: kubectl get pod -n default -l app=${{ env.APP_NAME }}
- name: k8s Update Deployment
uses: http://139.9.216.111:3000/bamanker/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: rollout restart deployment ${{ env.CONTAINER_NAME }}-${{ gitea.ref_name }}
run: kubectl rollout restart deployment ${{ env.APP_NAME }}

View File

@@ -1,7 +1,7 @@
# 基于 java25 构建
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/openjdk:25-jdk-slim
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/ubuntu:jammy
# 基于构建上下文 . 进行COPY 文件到 /root目录下
COPY target/myk3sTest.jar /root/myk3sTest/
COPY target/myk3sTest /root/myk3sTest/
EXPOSE 9090
# 容器启动执行的命令
CMD java -jar -Xms20m -Xmx20m -Dspring.profiles.active=test /root/myk3sTest/myk3sTest.jar
CMD /root/myk3sTest/myk3sTest -XX:StartFlightRecording='filename=recording.jfr,dumponexit=true,duration=10s'

62
deployment-temp.yml Normal file
View File

@@ -0,0 +1,62 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: $APP_NAME
version: $APP_TAG
name: $APP_NAME
namespace: default
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: $APP_NAME
strategy:
rollingUpdate:
maxSurge: 50%
maxUnavailable: 50%
type: RollingUpdate
template:
metadata:
labels:
app: $APP_NAME
version: $APP_TAG
spec:
containers:
- image: $REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$APP_TAG
name: $APP_NAME
imagePullPolicy: Always
livenessProbe: # 存活探针:失败意味着应用彻底挂了,需要重启来恢复
httpGet:
path: /test
port: 9090
initialDelaySeconds: 10 # 延迟xx秒开始执行
periodSeconds: 15 # 每隔15秒执行一次
timeoutSeconds: 10 # 10秒未返回结果则超时
failureThreshold: 10 # 探测失败后的重试次数,当达到这个次数后就判定结果为失败
# successThreshold: 5
ports:
- containerPort: 9090
imagePullSecrets:
- name: dockerhub-id
---
apiVersion: v1
kind: Service
metadata:
labels:
app: $APP_NAME
name: $APP_NAME
namespace: default
spec:
type: NodePort
externalTrafficPolicy: Local
ports:
- name: http
protocol: TCP
port: 9090
nodePort: 30909
selector:
app: $APP_NAME

61
pom.xml
View File

@@ -8,9 +8,10 @@
<version>4.0.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.bamanker</groupId>
<artifactId>myk3sTest</artifactId>
<version>0.0.1</version>
<version>v3.1-native</version>
<name>myk3sTest</name>
<description>myk3sTest</description>
<url/>
@@ -28,11 +29,13 @@
</scm>
<properties>
<java.version>25</java.version>
<app.version>${version}</app.version>
<app.name>${artifactId}</app.name>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -59,15 +62,62 @@
<build>
<finalName>myk3sTest</finalName>
<!--指定filtering=true.maven的占位符解析表达式就可以用于它里面的文件-->
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<mainClass>com.bamanker.myk3stest.Myk3sTestApplication</mainClass>
<buildArgs>
<!--开启dashboard-->
<!-- <arg>-H:DashboardDump=dailylove -H:+DashboardAll</arg>-->
<arg->-H:+ReportExceptionStackTraces</arg->
<!--开启JFR-->
<arg>--enable-monitoring=jfr</arg>
<!-- <arg>&#45;&#45;gc=G1</arg>-->
<!-- <arg>&#45;&#45;pgo</arg>-->
<arg>-Ob</arg>
<!-- <arg>-march=native</arg>-->
<!-- <arg>-H:+BuildReport</arg>-->
</buildArgs>
<!--启动详细输出-->
<verbose>true</verbose>
<!--配置jvm参数-->
<!-- <jvmArgs>
</jvmArgs>-->
<!--<agent>
<enabled>true</enabled>
<options>
<option>experimental-class-loader-support</option>
</options>
</agent>-->
</configuration>
</plugin>
<plugin>
<!--支持yaml读取pom的参数-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<delimiters>
<delimiter>@</delimiter>
</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>25</source>
<target>25</target>
<annotationProcessorPaths>
<path>
<groupId>org.springframework.boot</groupId>
@@ -79,13 +129,11 @@
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
@@ -96,5 +144,4 @@
</plugin>
</plugins>
</build>
</project>