Compare commits
5 Commits
6e2e0f0ed0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bea436058d | ||
|
|
000f34a059 | ||
|
|
93837e0248 | ||
|
|
e90fa00227 | ||
|
|
bd18f32670 |
@@ -59,12 +59,12 @@ jobs:
|
|||||||
- name: Update manifest and Push to Git
|
- name: Update manifest and Push to Git
|
||||||
run: |
|
run: |
|
||||||
# 使用 kustomize 或 sed 修改镜像版本
|
# 使用 kustomize 或 sed 修改镜像版本
|
||||||
sed -i "s|image: .*:.*|image: harbor.0orz.top/go-example/go-example:${{ gitea.sha }}|g" deployment.yaml
|
sed -i "s|image: .*:.*|image: harbor.0orz.top/go-example/go-example:${{ gitea.sha }}|g" kustomize/deployment.yaml
|
||||||
|
|
||||||
# 配置 Git 并提交回仓库
|
# 配置 Git 并提交回仓库
|
||||||
git config --global user.name "Gitea Action"
|
git config --global user.name "Gitea Action"
|
||||||
git config --global user.email "action@gitea.io"
|
git config --global user.email "action@gitea.io"
|
||||||
git add deployment.yaml
|
git add kustomize/deployment.yaml
|
||||||
git commit -m "chore: update image to ${{ gitea.sha }} [skip ci]"
|
git commit -m "chore: update image to ${{ gitea.sha }} [skip ci]"
|
||||||
git push origin main
|
git push origin main
|
||||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ flux bootstrap git \
|
|||||||
--branch=$BRANCH \
|
--branch=$BRANCH \
|
||||||
--username=$USER_NAME \
|
--username=$USER_NAME \
|
||||||
--token-auth=true \
|
--token-auth=true \
|
||||||
--path=./
|
--path=./clusters/app
|
||||||
|
|||||||
17
clusters/app/go-example-kustomization.yaml
Normal file
17
clusters/app/go-example-kustomization.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: go-example
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 30m0s
|
||||||
|
path: ./kustomize
|
||||||
|
prune: true
|
||||||
|
retryInterval: 2m0s
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: go-example
|
||||||
|
targetNamespace: helloapp
|
||||||
|
timeout: 3m0s
|
||||||
|
wait: true
|
||||||
11
clusters/app/go-example-source.yaml
Normal file
11
clusters/app/go-example-source.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: GitRepository
|
||||||
|
metadata:
|
||||||
|
name: go-example
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 1m0s
|
||||||
|
ref:
|
||||||
|
branch: main
|
||||||
|
url: https://git.0orz.top/Zpekii/go-example
|
||||||
@@ -33,7 +33,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: go-example
|
- name: go-example
|
||||||
image: harbor.0orz.top/go-example/go-example:8b5d44399e523027840a68ce17249d9ecfd5c094
|
image: harbor.0orz.top/go-example/go-example:000f34a0591306e686e8cf06bf131449eb30b028
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
Reference in New Issue
Block a user