Compare commits

...

23 Commits
v0.2 ... v0.98

Author SHA1 Message Date
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
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
bamanker
b365bf356a 修改了deployment.yml文件
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m6s
2025-12-25 09:31:35 +08:00
bamanker
8f782c8327 版本号为tag 0000000
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m44s
2025-12-25 00:10:20 +08:00
bamanker
a92abc0425 版本号为tag 00000
Some checks failed
Build Push and Deploy Image / build (push) Failing after 14s
2025-12-24 23:57:34 +08:00
bamanker
2c7953a17e 版本号为tag 000
Some checks failed
Build Push and Deploy Image / build (push) Failing after 0s
2025-12-24 23:54:25 +08:00
bamanker
f279baf126 版本号为tag 0
Some checks failed
Build Push and Deploy Image / build (push) Failing after 15s
2025-12-24 23:47:34 +08:00
bamanker
6d86a69c0b 版本号为tag 0
Some checks failed
Build Push and Deploy Image / build (push) Failing after 43s
2025-12-24 23:26:30 +08:00
bamanker
cc7e260325 版本号为tag
Some checks failed
Build Push and Deploy Image / build (push) Failing after 46s
2025-12-24 23:22:38 +08:00
4 changed files with 111 additions and 56 deletions

View File

@@ -1,36 +1,4 @@
---
## 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:

View File

@@ -2,8 +2,12 @@ name: Build Push and Deploy Image
on:
push:
branches:
- main
#tag 触发
tags:
- 'v*'
# 分支触发
# branches:
# - main
workflow_dispatch: #手动构建h
env:
@@ -22,17 +26,22 @@ jobs:
# 下载仓库源码依赖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
# with:
# java-version: '25.0.1'
# distribution: 'openjdk'
# cache: 'maven'
# - name: Set up Java
# uses: https://gitee.com/bamanker/setup-java@v5
# with:
# java-version: '25.0.1'
# distribution: 'openjdk'
# cache: 'maven'
#检查java版本
- 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)
run: echo $(pwd);ls
- name: Build with Maven
# 设置Maven执行权限使用maven绝对路径执行打包命令
run: /usr/local/maven/bin/mvn clean package -DskipTests -Pprod
@@ -46,7 +55,7 @@ jobs:
# 这里也可以通过 secrets 传入,后面再介绍
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# 获取时间戳,用于设置镜像 TAG 版本
# 获取时间戳
- name: Get datetime
id: datetime
run: |
@@ -54,25 +63,26 @@ jobs:
# 构建并上传镜像
- name: Build and push Docker image
uses: http://139.9.216.111:3000/bamanker/build-push-action@v6
uses: http://139.9.216.111:3000/bamanker/build-push-action@v6 # 获取上一步截取到的版本号,既 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 }}:${{ steps.datetime.outputs.datetime }}
tags: ${{ env.REGISTRY }}/${{ 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 }}
uses: http://139.9.216.111:3000/bamanker/steevchen-kubectl@master
with:
args: apply -f http://${{ secrets.DEVOPS_GITEA_TOKEN }}@/bamanker/myk3sTest/src/branch/master/.deploy/deployment.yml
- 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 }}
config: ${{ secrets.KUBE_CONFIG }}
command: apply -f http://${{ secrets.DEVOPS_GITEA_TOKEN }}@139.9.216.111:3000/bamanker/myk3sTest/src/branch/master/.deploy/deployment.yml
# - 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 }}

79
deployment.yml Normal file
View File

@@ -0,0 +1,79 @@
---
## 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

@@ -66,8 +66,6 @@
<configuration>
<source>25</source>
<target>25</target>
<annotationProcessorPaths>
<path>
<groupId>org.springframework.boot</groupId>