From 4afe3b0100b16aa281264d3898ae53ee8c290323 Mon Sep 17 00:00:00 2001 From: Zpekii Date: Sun, 18 Jan 2026 20:18:51 +0800 Subject: [PATCH] chore: rename prj --- .gitea/workflows/deploy.yaml | 6 +++--- deployment.yaml | 18 +++++++++--------- go.mod | 2 +- hello/hello.go | 2 +- main.go | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 993de0f..ad6ef15 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -49,14 +49,14 @@ jobs: - name: Build Docker image run: | cd ${{ gitea.workspace }} - docker build -t localhost:8180/k8s-example/k8s-example:${{ gitea.sha }} . + docker build -t localhost:8180/go-example/go-example:${{ gitea.sha }} . - name: Push Docker image to local registry run: | - docker push localhost:8180/k8s-example/k8s-example:${{ gitea.sha }} + docker push localhost:8180/go-example/go-example:${{ gitea.sha }} - name: Update manifest and Push to Git run: | # 使用 kustomize 或 sed 修改镜像版本 - sed -i "s|image: .*:.*|image: localhost:8180/k8s-example/k8s-example:${{ gitea.sha }}|g" deployment.yaml + sed -i "s|image: .*:.*|image: localhost:8180/go-example/go-example:${{ gitea.sha }}|g" deployment.yaml # 配置 Git 并提交回仓库 git config --global user.name "Gitea Action" diff --git a/deployment.yaml b/deployment.yaml index cbaa843..1b802e1 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -1,11 +1,11 @@ apiVersion: v1 kind: Service metadata: - name: k8s-example + name: go-example namespace: helloapp spec: selector: - app: k8s-example + app: go-example ports: - port: 8800 targetPort: 8800 @@ -14,21 +14,21 @@ spec: apiVersion: apps/v1 kind: Deployment metadata: - name: k8s-example + name: go-example namespace: helloapp spec: selector: matchLabels: - app: k8s-example + app: go-example replicas: 3 template: metadata: labels: - app: k8s-example + app: go-example spec: containers: - - name: k8s-example - image: localhost:8180/k8s-example/k8s-example:0b2c48ee261873d5a5b2146f424e2a68ce33d4da + - name: go-example + image: localhost:8180/go-example/go-example:0b2c48ee261873d5a5b2146f424e2a68ce33d4da imagePullPolicy: IfNotPresent resources: requests: @@ -49,7 +49,7 @@ spec: volumes: - name: config-volume configMap: - name: k8s-example-config + name: go-example-config - name: helloapp-test-key secret: secretName: helloapp-test-key @@ -57,7 +57,7 @@ spec: apiVersion: v1 kind: ConfigMap metadata: - name: k8s-example-config + name: go-example-config namespace: helloapp data: .linux-config.yaml: | diff --git a/go.mod b/go.mod index 4ad11d1..e4d1b4d 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module k8s-example +module go-example go 1.25.5 diff --git a/hello/hello.go b/hello/hello.go index d562e2b..4046187 100644 --- a/hello/hello.go +++ b/hello/hello.go @@ -3,7 +3,7 @@ package hello import ( "encoding/base64" "fmt" - "k8s-example/cmn/utils" + "go-example/cmn/utils" "net/http" "github.com/spf13/viper" diff --git a/main.go b/main.go index 4502cb3..5ec8f63 100644 --- a/main.go +++ b/main.go @@ -3,8 +3,8 @@ package main import ( "flag" "fmt" - "k8s-example/cmn/conf" - "k8s-example/hello" + "go-example/cmn/conf" + "go-example/hello" "net/http" "github.com/spf13/viper"