1
This commit is contained in:
56
.cnb.yml
56
.cnb.yml
@@ -41,8 +41,8 @@ main:
|
||||
depends_on:
|
||||
- sync to github
|
||||
|
||||
# ========== 编译Logic服务 ==========
|
||||
- name: build logic
|
||||
# ========== 编译Logic和Login服务 ==========
|
||||
- name: build
|
||||
image: golang:1.23
|
||||
cpus: 1
|
||||
environment:
|
||||
@@ -52,36 +52,25 @@ main:
|
||||
commands:
|
||||
- source .build-info/.env && BUILD_VERSION="${BUILD_VERSION}"
|
||||
- mkdir -p build
|
||||
- BIN_NAME="logic_${BUILD_VERSION}"
|
||||
- go mod download -x
|
||||
- go build -v -p=1 -trimpath -buildvcs=false -ldflags "-s -w -buildid= -extldflags '-static'" -o ./build/${BIN_NAME} ./logic
|
||||
- chmod +x ./build/${BIN_NAME}
|
||||
- ls -lh ./build/
|
||||
- file ./build/${BIN_NAME}
|
||||
depends_on:
|
||||
- cache go modules
|
||||
- set version
|
||||
|
||||
# ========== 编译Login服务 ==========
|
||||
- name: build login
|
||||
image: golang:1.23
|
||||
cpus: 1
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: on
|
||||
GOSUMDB: off
|
||||
commands:
|
||||
- source .build-info/.env && BUILD_VERSION="${BUILD_VERSION}"
|
||||
- cd login
|
||||
- mkdir -p build
|
||||
- BIN_NAME="login_${BUILD_VERSION}"
|
||||
- go mod download -x
|
||||
- go build -v -p=1 -trimpath -buildvcs=false -ldflags "-s -w -buildid= -extldflags '-static'" -o ./build/${BIN_NAME} .
|
||||
- chmod +x ./build/${BIN_NAME}
|
||||
- ls -lh ./build/
|
||||
- mv ./build/${BIN_NAME} ../build/
|
||||
- cd ..
|
||||
- ls -lh ./build/
|
||||
- |
|
||||
# 编译Logic服务
|
||||
BIN_NAME="logic_${BUILD_VERSION}"
|
||||
go mod download -x
|
||||
go build -v -p=1 -trimpath -buildvcs=false -ldflags "-s -w -buildid= -extldflags '-static'" -o ./build/${BIN_NAME} ./logic
|
||||
chmod +x ./build/${BIN_NAME}
|
||||
ls -lh ./build/${BIN_NAME}
|
||||
file ./build/${BIN_NAME}
|
||||
- |
|
||||
# 编译Login服务
|
||||
cd login
|
||||
BIN_NAME="login_${BUILD_VERSION}"
|
||||
go mod download -x
|
||||
go build -v -p=1 -trimpath -buildvcs=false -ldflags "-s -w -buildid= -extldflags '-static'" -o ./build/${BIN_NAME} .
|
||||
chmod +x ./build/${BIN_NAME}
|
||||
ls -lh ./build/${BIN_NAME}
|
||||
mv ./build/${BIN_NAME} ../build/
|
||||
cd ..
|
||||
ls -lh ./build/
|
||||
depends_on:
|
||||
- cache go modules
|
||||
- set version
|
||||
@@ -97,8 +86,7 @@ main:
|
||||
- /root/.cache/go-build
|
||||
cache_key: '{{ .Repo.Name }}-{{ .Commit.Branch }}-{{ checksum "go.mod" }}-{{ checksum "login/go.mod" }}'
|
||||
depends_on:
|
||||
- build logic
|
||||
- build login
|
||||
- build
|
||||
|
||||
# ========== SCP推送Login和Logic到指定服务器 ==========
|
||||
- name: deploy to login server
|
||||
|
||||
Reference in New Issue
Block a user