Compare commits

..

12 Commits

Author SHA1 Message Date
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
2 changed files with 54 additions and 23 deletions

View File

@@ -2,27 +2,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: myk3s-test
labels:
app: $APP_NAME
version: $APP_TAG
name: $APP_NAME
namespace: default
spec:
replicas: 2
revisionHistoryLimit: 3
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: myk3s-test
app: $APP_NAME
strategy:
rollingUpdate:
maxSurge: 50%
maxUnavailable: 50%
type: RollingUpdate
template:
metadata:
labels:
app: myk3s-test
app: $APP_NAME
version: $APP_TAG
spec:
containers:
- image: registry.cn-chengdu.aliyuncs.com/bamanker/myk3stest:lastest
name: myk3s-test
- image: registry.cn-chengdu.aliyuncs.com/bamanker/myk3stest:$APP_TAG #$REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME
name: $APP_NAME
imagePullPolicy: Always
readinessProbe:
httpGet:
path: /actuator/health
port: 9090
initialDelaySeconds: 1
timeoutSeconds: 10
failureThreshold: 30
successThreshold: 5
ports:
- containerPort: 9090
@@ -32,14 +45,17 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: myk3s-test
labels:
app: $APP_NAME
name: $APP_NAME
namespace: default
spec:
type: NodePort
externalTrafficPolicy: Local
ports:
- name: http-8080
- name: http
protocol: TCP
port: 9090
nodePort: 30099
nodePort: 9090
selector:
app: myk3s-test
app: $APP_NAME

View File

@@ -14,7 +14,7 @@ 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
APP_NAME: myk3s-test
jobs:
# 构建 Job
@@ -38,10 +38,19 @@ jobs:
# 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);ls
# - name: Check java version
# run: java -version
- name: Set Env Var
env:
TAG: ${{ steps.get_version.outputs.version }}
run: |
export APP_TAG=${{ env.TAG }} |
# echo APP_TAG=${{ env.TAG }} |
# export APP_NAME=${{ env.APP_NAME }} |
# echo APP_NAME=${{ env.APP_NAME }} |
- name: Inject Env Var
run: |
envsubst < .deploy/deployment.yml
- name: Build with Maven
# 设置Maven执行权限使用maven绝对路径执行打包命令
run: /usr/local/maven/bin/mvn clean package -DskipTests -Pprod
@@ -78,11 +87,17 @@ jobs:
uses: http://139.9.216.111:3000/bamanker/steevchen-kubectl@master
with:
config: ${{ secrets.KUBE_CONFIG }}
command: apply -f http://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 }}
command: apply -f http://139.9.216.111:3000/bamanker/myk3sTest/raw/branch/master/.deploy/deployment.yml
- name: k8s Check Pods Health
uses: http://139.9.216.111:3000/bamanker/steevchen-kubectl@master
with:
config: ${{ secrets.KUBE_CONFIG }}
command: get pod -n default -l app=${{ env.APP_NAME }}
- name: k8s Update Deployment
uses: http://139.9.216.111:3000/bamanker/steevchen-kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
command: rollout restart deployment ${{ env.APP_NAME }}-${{ gitea.ref_name }}