From 0fd4e37175aedc154b52bde3a2891293f95d5e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E6=AD=A6?= <875892894@qq.com> Date: Thu, 1 Aug 2024 18:15:15 +0800 Subject: [PATCH] test --- .drone.yml | 49 ++++++++++++++++++++++++++++++++++++++++++++++ config.yaml | 6 +++--- initialize/grpc.go | 8 ++------ 3 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..84e58aa --- /dev/null +++ b/.drone.yml @@ -0,0 +1,49 @@ +workspace: + base: /project + path: src/demo + +branches: [ master,develop,uat ] + + +pipeline: + + build: + image: golang:1.20-alpine + commands: + - export GO111MODULE=on + - export GOPROXY=https://goproxy.cn,direct + - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server.app + # - make build + + docker-dev: + image: plugins/docker + repo: registry.cn-shenzhen.aliyuncs.com/ax-stor/ax-bkb-seller + registry: registry.cn-shenzhen.aliyuncs.com + use_cache: true + dockerfile: Dockerfile + secrets: [ docker_username, docker_password ] + tags: app-api + when: + branch: develop + + # deploy-dev: + # image: roffe/kubectl + # commands: + # - rm -rf /root/.kube && cp -r .kube /root + # - kubectl delete -f deployDev.yaml || true + # - kubectl apply -f deployDev.yaml + # when: + # branch: develop + deploy-dev: + image: appleboy/drone-ssh + host: 1.92.109.79 + username: root + password: + from_secret: ssh_password + port: 22 # 可选,指定 SSH 端口,默认为 22 + script: + - docker rm -f app-api + - docker pull registry.cn-shenzhen.aliyuncs.com/ax-stor/ax-bkb-seller:app-api + - docker run --name=app-api -p 30201:8001 -d registry.cn-shenzhen.aliyuncs.com/ax-stor/ax-bkb-seller:app-api + when: + branch: develop \ No newline at end of file diff --git a/config.yaml b/config.yaml index 9ec157f..afbaa51 100644 --- a/config.yaml +++ b/config.yaml @@ -37,11 +37,11 @@ jwt: local: path: uploads/file mysql: - path: 172.16.0.26:3306 + path: 1.92.109.79:30306 config: charset=utf8mb4&parseTime=True&loc=Local db-name: bkb - username: bkbrd - password: yJGQ3hlV#*4nTJrn + username: root + password: vBwU7vwAGQ max-idle-conns: 10 max-open-conns: 100 log-mode: info diff --git a/initialize/grpc.go b/initialize/grpc.go index 6764cbc..8e99e67 100644 --- a/initialize/grpc.go +++ b/initialize/grpc.go @@ -17,13 +17,11 @@ import ( func PaymentClient() api.GreeterClient { sc := []constant.ServerConfig{ - *constant.NewServerConfig("72535c70-8d6d-400f-9893-4bb3e634f682.nacos.cn-north-4.cse.myhuaweicloud.com", 8848), + *constant.NewServerConfig("1.92.109.79", 30848), } cc := constant.ClientConfig{ NamespaceId: "dev", TimeoutMs: 5000, - Username: "nacos", - Password: "nacos", } client, err := clients.NewNamingClient( vo.NacosClientParam{ @@ -51,13 +49,11 @@ func PaymentClient() api.GreeterClient { func InitNacosClient() { sc := []constant.ServerConfig{ - *constant.NewServerConfig("72535c70-8d6d-400f-9893-4bb3e634f682.nacos.cn-north-4.cse.myhuaweicloud.com", 8848), + *constant.NewServerConfig("1.92.109.79", 30848), } cc := constant.ClientConfig{ NamespaceId: "dev", TimeoutMs: 5000, - Username: "nacos", - Password: "nacos", } func() { client, err := clients.NewNamingClient(