Compare commits
21 Commits
v3.6.6-nat
...
v3.8.3-nat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d1dc22670 | ||
|
|
52e4616bb3 | ||
|
|
79fba8746f | ||
|
|
80122ebe57 | ||
|
|
148672031f | ||
|
|
fdcc48178f | ||
|
|
1f9029baf1 | ||
|
|
df57e63c3e | ||
|
|
d6b67b428b | ||
|
|
f3eeaf48fd | ||
|
|
46f1b7ca22 | ||
|
|
c7d1bedf79 | ||
|
|
8dc0e1f9d7 | ||
|
|
5cb44e596c | ||
|
|
2f9ff5f9c9 | ||
|
|
cfbd38a09d | ||
|
|
057cb5de38 | ||
|
|
bf1f52ad54 | ||
|
|
1696261450 | ||
|
|
5ca35df955 | ||
|
|
21bc585376 |
@@ -21,7 +21,9 @@ env:
|
|||||||
# 构建 Job
|
# 构建 Job
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-node24 # 如果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:
|
steps:
|
||||||
- name: Print system info 1
|
- name: Print system info 1
|
||||||
run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
|
run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
|
||||||
@@ -32,21 +34,26 @@ jobs:
|
|||||||
- name: Print env
|
- name: Print env
|
||||||
run: env
|
run: env
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: apt-get update && apt-get install -y gettext && apt-get install -y maven && apt-get install -y docker.io
|
run: apt-get update &&
|
||||||
|
apt-get install -y gettext &&
|
||||||
|
apt-get install -y maven &&
|
||||||
|
apt-get install coreutils &&
|
||||||
|
apt-get update &&
|
||||||
|
apt-get install docker-ce-cli
|
||||||
- name: Generate maven config
|
- name: Generate maven config
|
||||||
uses: http://139.9.216.111:3000/bamanker/maven-settings-action@v3.1.0
|
uses: http://139.9.216.111:3000/bamanker/maven-settings-action@v3.1.0
|
||||||
with:
|
with:
|
||||||
mirrors: '[{"id": "alimaven", "name": "aliyun maven", "mirrorOf": "central", "url": "http://maven.aliyun.com/nexus/content/groups/public/"}]'
|
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
|
# - uses: http://localhost:3000/bamanker/setup-node@v6
|
||||||
# with:
|
# with:
|
||||||
# node-version: 24
|
# node-version: 24
|
||||||
# cache: 'npm'
|
# cache: 'npm'
|
||||||
# - run: node -v
|
# - run: node -v
|
||||||
# 下载仓库源码,依赖node环境,因此构建服务器本地需要下载安装node并设置环境变量
|
# 下载仓库源码,依赖node环境,因此构建服务器本地需要下载安装node并设置环境变量
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
# - name: Set up Docker Buildx
|
||||||
uses: http://139.9.216.111:3000/bamanker/setup-buildx-action@v3
|
# uses: http://139.9.216.111:3000/bamanker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Checkout repository code
|
- name: Checkout repository code
|
||||||
#使用自定义仓库action
|
#使用自定义仓库action
|
||||||
@@ -65,7 +72,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "The app version is $APP_TAG" && echo "tag=$APP_TAG" >> $GITHUB_OUTPUT &&
|
echo "The app version is $APP_TAG" && echo "tag=$APP_TAG" >> $GITHUB_OUTPUT &&
|
||||||
echo "now workspace: ${{ github.workspace }}" &&
|
echo "now workspace: ${{ github.workspace }}" &&
|
||||||
pwd
|
pwd &&
|
||||||
|
docker version
|
||||||
|
|
||||||
# 为其他配置文件注入环境变量
|
# 为其他配置文件注入环境变量
|
||||||
- name: Inject envVar
|
- name: Inject envVar
|
||||||
@@ -100,18 +108,20 @@ jobs:
|
|||||||
# run: |
|
# run: |
|
||||||
# echo "datetime=$(date '+%Y-%m-%d-%H-%M-%S')" >> $GITHUB_OUTPUT
|
# echo "datetime=$(date '+%Y-%m-%d-%H-%M-%S')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# 构建并上传镜像
|
# 构建并上传镜像 TODO 直接用docker命令操作
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: http://139.9.216.111:3000/bamanker/build-push-action@v4 # 获取上一步截取到的版本号,既 1.0.0
|
# uses: http://139.9.216.111:3000/bamanker/build-push-action@v4 # 获取上一步截取到的版本号,既 1.0.0
|
||||||
#只能这样接收
|
#只能这样接收
|
||||||
env:
|
env:
|
||||||
TAG: ${{ steps.set_envar.outputs.tag }}
|
TAG: ${{ steps.set_envar.outputs.tag }}
|
||||||
with:
|
run: |
|
||||||
context: .
|
docker buildx build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} --push .
|
||||||
platforms: linux/amd64
|
# with:
|
||||||
file: Dockerfile
|
# context: .
|
||||||
push: true
|
## platforms: linux/amd64
|
||||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
|
# file: Dockerfile
|
||||||
|
# push: true
|
||||||
|
# tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
|
||||||
|
|
||||||
#发布到 k8s
|
#发布到 k8s
|
||||||
- name: Generate kubeconfig
|
- name: Generate kubeconfig
|
||||||
|
|||||||
@@ -29,14 +29,15 @@ spec:
|
|||||||
- image: $REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$APP_TAG
|
- image: $REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$APP_TAG
|
||||||
name: $APP_NAME
|
name: $APP_NAME
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
readinessProbe:
|
livenessProbe: # 存活探针:失败意味着应用彻底挂了,需要重启来恢复
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /test
|
path: /test
|
||||||
port: 9090
|
port: 9090
|
||||||
initialDelaySeconds: 1
|
initialDelaySeconds: 10 # 延迟xx秒开始执行
|
||||||
timeoutSeconds: 10
|
periodSeconds: 15 # 每隔15秒执行一次
|
||||||
failureThreshold: 30
|
timeoutSeconds: 10 # 10秒未返回结果则超时
|
||||||
successThreshold: 5
|
failureThreshold: 10 # 探测失败后的重试次数,当达到这个次数后就判定结果为失败
|
||||||
|
# successThreshold: 5
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9090
|
- containerPort: 9090
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<groupId>com.bamanker</groupId>
|
<groupId>com.bamanker</groupId>
|
||||||
<artifactId>myk3sTest</artifactId>
|
<artifactId>myk3sTest</artifactId>
|
||||||
<version>v3.1.0-native</version>
|
<version>v3.1-native</version>
|
||||||
<name>myk3sTest</name>
|
<name>myk3sTest</name>
|
||||||
<description>myk3sTest</description>
|
<description>myk3sTest</description>
|
||||||
<url/>
|
<url/>
|
||||||
|
|||||||
Reference in New Issue
Block a user