perf: 重构目录结构
This commit is contained in:
21
README.md
21
README.md
@@ -77,18 +77,18 @@ apt install -y libpcap-dev
|
||||
go env -w CGO_ENABLED='1'
|
||||
|
||||
# 调试启动
|
||||
go run restagent.go -c ./etc/restconf.yaml --env local
|
||||
go run main.go --env local -c ./local/omc.yaml
|
||||
|
||||
# 调试分析
|
||||
# http://127.0.0.1:33060/debug/pprof/
|
||||
go tool pprof -http=:9090 http://127.0.0.1:33060/debug/pprof/heap
|
||||
|
||||
# 生成 swagger 文档
|
||||
swag init -d ./ -g ./restagent/restagent.go -o ./swagger2docs
|
||||
swag fmt -d ./ -g ./restagent/restagent.go
|
||||
swag init -d ./ -g main.go -o ./swagger_docs
|
||||
swag fmt -d ./ -g main.go
|
||||
|
||||
# 打包命名 restagent
|
||||
go build -ldflags="-s -w" -o restagent
|
||||
go build -ldflags="-s -w" -o omc
|
||||
```
|
||||
|
||||
## 打包
|
||||
@@ -98,9 +98,7 @@ go env -w GOOS=linux
|
||||
|
||||
go env -w GOOS=windows
|
||||
|
||||
cd ./restagent
|
||||
|
||||
go build -o restagent -v -ldflags="-s -w -X 'be.ems/lib/global.Version=24.09.20' -X 'be.ems/lib/global.BuildTime=`date`' -X 'be.ems/lib/global.GoVer=`go version`'"
|
||||
go build -o omc -v -ldflags="-s -w -X 'be.ems/src/framework/config.Version=2.2503.14' -X 'be.ems/src/framework/config.BuildTime=$(date)' -X 'be.ems/src/framework/config.GoVer=$(go version)'"
|
||||
|
||||
```
|
||||
|
||||
@@ -130,10 +128,9 @@ INSERT INTO cdr_event_smsc_bak SELECT * FROM cdr_event_smsc WHERE TIMESTAMP <= 1
|
||||
DELETE FROM cdr_event_smsc WHERE TIMESTAMP <= 1739540000
|
||||
|
||||
# 执行数据库脚本
|
||||
cd ./restagent
|
||||
./restagent.exe -c ./etc/restconf.yaml --sqlPath ../database/common --sqlSource default
|
||||
./restagent.exe -c ./etc/restconf.yaml --sqlPath ../database/install --sqlSource default
|
||||
./restagent.exe -c ./etc/restconf.yaml --sqlPath ../database/upgrade/upg_20250313.sql --sqlSource lite
|
||||
./omc.exe -c ./local/omc.yaml --sqlPath ./build/linux/usr/local/etc/omc/database/common/mysql --sqlSource default
|
||||
./omc.exe -c ./local/omc.yaml --sqlPath ./build/linux/usr/local/etc/omc/database/install/mysql --sqlSource default
|
||||
./omc.exe -c ./local/omc.yaml --sqlPath ./build/linux/usr/local/etc/omc/database/upgrade/sqlite/upg_20250313.sql --sqlSource lite
|
||||
|
||||
/usr/local/omc/bin/restagent -c /usr/local/omc/etc/restconf.yaml --sqlPath /usr/local/omc/etc/db/upgrade/upg_20250313.sql --sqlSource lite
|
||||
/usr/local/bin/omc -c /usr/local/etc/omc.yaml --sqlPath /usr/local/etc/omc/database/upgrade/sqlite/upg_20250313.sql --sqlSource lite
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user