Compare commits

..

71 Commits

Author SHA1 Message Date
bamanker
4baa013d02 更改kubectl的action为手动下载1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 22m5s
2026-01-04 22:43:23 +08:00
bamanker
6e1ec6a761 更改kubectl的action为手动下载
Some checks failed
Build Push and Deploy Image / build (push) Failing after 24m41s
2026-01-04 22:10:59 +08:00
bamanker
7ebd4ba157 更改kubectl的action2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 21m41s
2026-01-04 18:01:36 +08:00
bamanker
75d0f8d768 更改kubectl的action1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 24m48s
2026-01-04 17:15:47 +08:00
bamanker
afa97145c1 更改kubectl的action
Some checks failed
Build Push and Deploy Image / build (push) Failing after 21m57s
2026-01-04 16:13:16 +08:00
bamanker
2f39836963 修复mount source: "overlay" 错误的问题 5
Some checks failed
Build Push and Deploy Image / build (push) Failing after 21m14s
2026-01-04 15:19:05 +08:00
bamanker
d9807291ad 修复mount source: "overlay" 错误的问题 4
Some checks failed
Build Push and Deploy Image / build (push) Failing after 2m19s
2026-01-04 14:59:41 +08:00
bamanker
27c3ab7b82 修复mount source: "overlay" 错误的问题 3
Some checks failed
Build Push and Deploy Image / build (push) Failing after 24s
2026-01-04 14:58:27 +08:00
bamanker
67ce2b5c86 修复mount source: "overlay" 错误的问题 2
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2026-01-04 14:03:19 +08:00
bamanker
be67a8fef0 修复mount source: "overlay" 错误的问题 1
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2026-01-04 13:09:17 +08:00
bamanker
6b47cfd5f8 修复mount source: "overlay" 错误的问题 1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 2m11s
2026-01-04 12:55:38 +08:00
bamanker
d5ab5e6727 修复mount source: "overlay", target 错误的问题
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m25s
2026-01-04 12:51:32 +08:00
bamanker
adcf60eeb6 修改了dockerfile中的基础镜像2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m12s
2026-01-04 12:23:20 +08:00
bamanker
5b20c46c5d 修改了dockerfile中的基础镜像1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 20m34s
2026-01-04 11:37:15 +08:00
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
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
4 changed files with 101 additions and 38 deletions

View File

@@ -21,21 +21,58 @@ env:
# 构建 Job
jobs:
build:
runs-on: ubuntu-jammy # 如果host构建 linux_amd64
runs-on: ubuntu-node22 # 如果host构建:linux_amd64
# container:
# image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/ghcr.io/catthehacker/ubuntu:act-latest
steps:
- run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo " This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- run: env
- uses: http://localhost:3000/bamanker/setup-node@v6
- 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 && blkid
- 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.6.0
with:
node-version: 24
cache: 'npm'
- run: node -v
version: type=archive,channel=stable,version=v27.4.0
daemon-config: |
{
"registry-mirrors":["https://docker.1ms.run"],
"dns": ["8.8.8.8", "114.114.114.114"]
}
- 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:
# 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://localhost:3000/bamanker/checkout@v6
uses: http://139.9.216.111:3000/bamanker/checkout@v4
# 获取 TAG 并设置为环境变量
- name: Get version
@@ -49,8 +86,7 @@ jobs:
id: set_envar
run: |
echo "The app version is $APP_TAG" && echo "tag=$APP_TAG" >> $GITHUB_OUTPUT &&
echo "now workspace: ${{ github.workspace }}" &&
pwd
echo "now workspace: ${{ github.workspace }}"
# 为其他配置文件注入环境变量
- name: Inject envVar
@@ -60,7 +96,7 @@ jobs:
# 构建java项目
- name: Set up Java
uses: http://localhost:3000/bamanker/setup-java@v5
uses: http://139.9.216.111:3000/bamanker/setup-graalvm@v1
with:
distribution: 'graalvm'
java-version: '25.0.1'
@@ -72,7 +108,7 @@ jobs:
# 登录镜像仓库,方便后续上传镜像
- name: Login to Docker Registry
uses: http://localhost:3000/bamanker/login-action@v3
uses: http://139.9.216.111:3000/bamanker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -85,31 +121,57 @@ jobs:
# run: |
# echo "datetime=$(date '+%Y-%m-%d-%H-%M-%S')" >> $GITHUB_OUTPUT
# 构建并上传镜像
# 构建并上传镜像 TODO 直接用docker命令操作
- name: Build and push Docker image
uses: http://localhost: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.set_envar.outputs.tag }}
with:
context: .
platforms: linux/amd64
file: Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
run: |
ls &&
docker build --file Dockerfile --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} . &&
docker image ls
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
# ${{ 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 }}
#发布到 k8s
- name: Generate kubeconfig
uses: http://localhost:3000/bamanker/kubectl-action@v1.4.0
with:
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: Setup kubectl
run: |
curl -LO "https://dl.k8s.io/release/v1.33.0/bin/linux/amd64/kubectl" &&
chmod +x kubectl &&
mv kubectl /usr/local/bin/ &&
kubectl version
- name: Configure kubeconfig
# 假设您的 KUBE_CONFIG 秘密是 Base64 编码的 kubeconfig 文件内容
run: |
# 1. 创建 ~/.kube 目录
mkdir -p $HOME/.kube
# 2. 将 Base64 编码的 KUBE_CONFIG 秘密解码并写入默认配置文件
echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > $HOME/.kube/config
# 3. 确保 kubectl 知道配置文件的位置 (可选, 但安全)
echo "KUBECONFIG=$HOME/.kube/config" >> $GITHUB_ENV
- name: Deploy with kubectl
run: |
kubectl apply -f ./deployment.yml
#
- name: k8s Check Pods Health
run: kubectl get pod -n default -l app=${{ env.APP_NAME }}
run: |
args: get pod -n default -l app=${{ env.APP_NAME }}
- name: k8s Update Deployment
run: kubectl rollout restart deployment ${{ env.APP_NAME }}
run: |
rollout restart deployment ${{ env.APP_NAME }}

View File

@@ -1,5 +1,5 @@
# 基于 java25 构建
FROM ubuntu:jammy
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/ubuntu:jammy
# 基于构建上下文 . 进行COPY 文件到 /root目录下
COPY target/myk3sTest /root/myk3sTest/
EXPOSE 9090

View File

@@ -29,14 +29,15 @@ spec:
- image: $REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$APP_TAG
name: $APP_NAME
imagePullPolicy: Always
readinessProbe:
livenessProbe: # 存活探针:失败意味着应用彻底挂了,需要重启来恢复
httpGet:
path: /test
port: 9090
initialDelaySeconds: 1
timeoutSeconds: 10
failureThreshold: 30
successThreshold: 5
initialDelaySeconds: 10 # 延迟xx秒开始执行
periodSeconds: 15 # 每隔15秒执行一次
timeoutSeconds: 10 # 10秒未返回结果则超时
failureThreshold: 10 # 探测失败后的重试次数,当达到这个次数后就判定结果为失败
# successThreshold: 5
ports:
- containerPort: 9090
imagePullSecrets:

View File

@@ -11,7 +11,7 @@
<groupId>com.bamanker</groupId>
<artifactId>myk3sTest</artifactId>
<version>v3.1.0-native</version>
<version>v3.1-native</version>
<name>myk3sTest</name>
<description>myk3sTest</description>
<url/>