Browse Source

test

develop
文武 9 months ago
parent
commit
0fd4e37175
  1. 49
      .drone.yml
  2. 6
      config.yaml
  3. 8
      initialize/grpc.go

49
.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

6
config.yaml

@ -37,11 +37,11 @@ jwt:
local: local:
path: uploads/file path: uploads/file
mysql: mysql:
path: 172.16.0.26:3306 path: 1.92.109.79:30306
config: charset=utf8mb4&parseTime=True&loc=Local config: charset=utf8mb4&parseTime=True&loc=Local
db-name: bkb db-name: bkb
username: bkbrd username: root
password: yJGQ3hlV#*4nTJrn password: vBwU7vwAGQ
max-idle-conns: 10 max-idle-conns: 10
max-open-conns: 100 max-open-conns: 100
log-mode: info log-mode: info

8
initialize/grpc.go

@ -17,13 +17,11 @@ import (
func PaymentClient() api.GreeterClient { func PaymentClient() api.GreeterClient {
sc := []constant.ServerConfig{ 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{ cc := constant.ClientConfig{
NamespaceId: "dev", NamespaceId: "dev",
TimeoutMs: 5000, TimeoutMs: 5000,
Username: "nacos",
Password: "nacos",
} }
client, err := clients.NewNamingClient( client, err := clients.NewNamingClient(
vo.NacosClientParam{ vo.NacosClientParam{
@ -51,13 +49,11 @@ func PaymentClient() api.GreeterClient {
func InitNacosClient() { func InitNacosClient() {
sc := []constant.ServerConfig{ 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{ cc := constant.ClientConfig{
NamespaceId: "dev", NamespaceId: "dev",
TimeoutMs: 5000, TimeoutMs: 5000,
Username: "nacos",
Password: "nacos",
} }
func() { func() {
client, err := clients.NewNamingClient( client, err := clients.NewNamingClient(

Loading…
Cancel
Save