From 0af20ab14e23bdd3f1b8c88593deb931a1424433 Mon Sep 17 00:00:00 2001 From: danial Date: Wed, 17 Dec 2025 15:54:26 +0800 Subject: [PATCH] =?UTF-8?q?chore(ci):=20=E6=9B=B4=E6=96=B0CI=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=AD=E7=9A=84=E9=95=9C=E5=83=8F=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E5=92=8C=E7=99=BB=E5=BD=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将.drone.yml中docker登录地址由git.oceanpay.cc替换为git.domainpay.top - 修改相关docker构建、标记及推送的镜像路径为git.domainpay.top - 更新docker-compose.yml中所有服务的镜像地址至git.domainpay.top - 内部日志处理中添加错误日志打印,增强错误排查能力 --- .drone.yml | 24 +++++++----------------- docker-compose.yml | 18 +++++++++--------- internal/errHandler/handler.go | 2 ++ 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/.drone.yml b/.drone.yml index a20233a2..2dc6d4a9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ type: ssh name: master-machine server: - host: 38.38.251.113:34156 + host: 38.55.194.49:3422 user: root password: from_secret: www_password @@ -19,22 +19,12 @@ steps: DOCKER_TOKEN: from_secret: docker_token commands: - - docker login git.oceanpay.cc -u $DOCKER_LOGIN -p $DOCKER_TOKEN - - docker build -t git.oceanpay.cc/danial/kami_backend_${DRONE_BRANCH}:${DRONE_BUILD_NUMBER} -f manifest/docker/Dockerfile . --build-arg USE_PROXY=0 - - docker tag git.oceanpay.cc/danial/kami_backend_${DRONE_BRANCH}:${DRONE_BUILD_NUMBER} git.oceanpay.cc/danial/kami_backend_${DRONE_BRANCH}:latest - - docker push git.oceanpay.cc/danial/kami_backend_${DRONE_BRANCH}:${DRONE_BUILD_NUMBER} - - docker push git.oceanpay.cc/danial/kami_backend_${DRONE_BRANCH}:latest - - docker logout git.oceanpay.cc -# - name: deploy to docker compose -# environment: -# DOCKER_LOGIN: -# from_secret: docker_login -# DOCKER_TOKEN: -# from_secret: docker_token -# commands: -# - docker login git.oceanpay.cc -u $DOCKER_LOGIN -p $DOCKER_TOKEN -# - BRANCH=${DRONE_BRANCH} VERSION=${DRONE_BUILD_NUMBER} docker compose -f /data/kami/docker-compose.yaml --profile kami_backend up -d -# - docker logout git.oceanpay.cc + - docker login git.domainpay.top -u $DOCKER_LOGIN -p $DOCKER_TOKEN + - docker build -t git.domainpay.top/danial/kami_backend_${DRONE_BRANCH}:${DRONE_BUILD_NUMBER} -f manifest/docker/Dockerfile . --build-arg USE_PROXY=0 + - docker tag git.domainpay.top/danial/kami_backend_${DRONE_BRANCH}:${DRONE_BUILD_NUMBER} git.domainpay.top/danial/kami_backend_${DRONE_BRANCH}:latest + - docker push git.domainpay.top/danial/kami_backend_${DRONE_BRANCH}:${DRONE_BUILD_NUMBER} + - docker push git.domainpay.top/danial/kami_backend_${DRONE_BRANCH}:latest + - docker logout git.domainpay.top trigger: branch: diff --git a/docker-compose.yml b/docker-compose.yml index 39b81f20..c5e530b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: kami-db-migrate: - image: git.oceanpay.cc/danial/kami-db-migrate:latest + image: git.domainpay.top/danial/kami-db-migrate:latest container_name: kami-migrate profiles: - all @@ -20,7 +20,7 @@ services: labels: createdBy: Developer kami_merchant: - image: git.oceanpay.cc/danial/kami_merchant_$BRANCH:$VERSION + image: git.domainpay.top/danial/kami_merchant_$BRANCH:$VERSION container_name: kami-merchant-$BRANCH-$VERSION restart: always environment: @@ -41,7 +41,7 @@ services: labels: createdBy: Developer kami_backend: - image: git.oceanpay.cc/danial/kami_backend_$BRANCH:$VERSION + image: git.domainpay.top/danial/kami_backend_$BRANCH:$VERSION container_name: kami-backend-$BRANCH-$VERSION restart: always environment: @@ -65,7 +65,7 @@ services: labels: createdBy: Developer kami_shop: - image: git.oceanpay.cc/danial/kami_shop_$BRANCH:$VERSION + image: git.domainpay.top/danial/kami_shop_$BRANCH:$VERSION container_name: kami-shop-$BRANCH-$VERSION restart: always environment: @@ -86,7 +86,7 @@ services: labels: createdBy: Developer kami_gateway: - image: git.oceanpay.cc/danial/kami_gateway_$BRANCH:$VERSION + image: git.domainpay.top/danial/kami_gateway_$BRANCH:$VERSION container_name: kami-gateway-$BRANCH-$VERSION restart: always environment: @@ -110,7 +110,7 @@ services: labels: createdBy: Developer kami_boss: - image: git.oceanpay.cc/danial/kami_boss_$BRANCH:$VERSION + image: git.domainpay.top/danial/kami_boss_$BRANCH:$VERSION container_name: kami-boss-$BRANCH-$VERSION restart: always environment: @@ -131,7 +131,7 @@ services: labels: createdBy: Developer kami_frontend: - image: git.oceanpay.cc/danial/kami_frontend_$BRANCH:$VERSION + image: git.domainpay.top/danial/kami_frontend_$BRANCH:$VERSION container_name: kami-frontend-$BRANCH-$VERSION restart: always environment: @@ -149,7 +149,7 @@ services: - frontend - all kami-spider-monorepo: - image: git.oceanpay.cc/danial/kami-spider-monorepo-$BRANCH:$VERSION + image: git.domainpay.top/danial/kami-spider-monorepo-$BRANCH:$VERSION container_name: kami-spider-monorepo-$BRANCH-$VERSION restart: always profiles: @@ -177,7 +177,7 @@ services: labels: createdBy: Developer jd-token-server: - image: git.oceanpay.cc/danial/jd-token-server-$BRANCH:$VERSION + image: git.domainpay.top/danial/jd-token-server-$BRANCH:$VERSION container_name: jd-token-server-$BRANCH-$VERSION restart: always profiles: diff --git a/internal/errHandler/handler.go b/internal/errHandler/handler.go index 512a26d6..11c13d4c 100644 --- a/internal/errHandler/handler.go +++ b/internal/errHandler/handler.go @@ -3,6 +3,7 @@ package errHandler import ( "github.com/gogf/gf/v2/errors/gcode" "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/os/glog" "golang.org/x/net/context" ) @@ -11,6 +12,7 @@ func WrapError(ctx context.Context, code gcode.Code, err error, message ...strin return nil } newMsg := "" + glog.Error(ctx, "错误", err) if len(message) != 0 { newMsg = message[0] } else {