mind-sever 搭建环境 readme
modelfoundry-server
install deps
swag
We need swag to generate
go install github.com/swaggo/swag/cmd/swag@latest
docker
follow the docs
compose
follow the docs
local-dev
Before starting:
Then you can start a local dev environment by:
GH_USER=yourname GH_TOKEN=yourtoken bash -ex scripts/init-env.sh
This command will launch a server listen on 127.0.0.1:8888
update swagger docs
switch into root dir of the project
swag init --parseDependency --parseInternal --instanceName rest -o api -t Organization,User,Model,ModelRestful,Space,SpaceRestful,SpaceAppRestful,BranchRestful,ActivityRestful
swag init --parseDependency --parseInternal --instanceName web -o api -t Organization,User,Session,Model,ModelWeb,Space,SpaceWeb,SpaceAppWeb,CodeRepo,ActivityWeb,SearchWeb,ComputilityWeb,Other
swag init --parseDependency --parseInternal --instanceName internal -o api -t SessionInternal,UserInternal,SpaceInternal,ModelInternal,Permission,SpaceApp,ActivityInternal,ComputilityInternal,CodeRepoInternal
update copyright comment
copyright_comment="/*
Copyright (c) Huawei Technologies Co., Ltd. 2023-2024. All rights reserved
*/"
for file in $ROOTDIR/api/*.go
do
echo -e "$copyright_comment\n\n$(cat $file)" > $file
done
run end to end test
GH_USER=yourname GH_TOKEN=yourtoken bash -ex scripts/init-env.sh && bash scripts/openapi.sh
cd tests/e2e
go test -v ./...
本文来自博客园,作者:易先讯,转载请注明原文链接:https://www.cnblogs.com/gongxianjin/p/18233823