提交 58a641d7 编写于 作者: lwplvx's avatar lwplvx

scripts run.py ok support startup port

上级 19f2a5f7
......@@ -46,16 +46,16 @@ namespace Aurora.Tenant.Api.Controllers
return res;
}
[HttpGet]
/// <summary>
/// get tenant by current request url
/// </summary>
/// <returns></returns>
public async Task<ResponseModel<TenantUserDto>> GetByUrl(string url)
{
var res = await _tenantService.GetById(id);
return res;
}
// [HttpGet]
// /// <summary>
// /// get tenant by current request url
// /// </summary>
// /// <returns></returns>
// public async Task<ResponseModel<TenantUserDto>> GetByUrl(string url)
// {
// var res = await _tenantService.get(url);
// return res;
// }
[HttpPost]
/// <summary>
......
......@@ -36,9 +36,21 @@ def poutput(name, pid): # 定义函数名
f.write(pid+'\n') # 加\n换行显示
def start_dotnetservice(name, runPath):
start_service(
name, 'dotnet run --project {}'.format(os.path.join(runPath, name, name+'.csproj')))
# dotnet Aurora.Gateway.dll --urls "http://*:6002"
# dotnet build E:\Workspace\aurora\Aurora.Gateway\Aurora.Gateway.csproj ;cd E:\Workspace\aurora\Aurora.Gateway\bin\Debug\net5.0;dotnet Aurora.Gateway.dll
def start_dotnetservice(name, runPath, port):
projectPath = os.path.join(runPath, name)
dllPath = os.path.join(projectPath, r'bin\Debug\net5.0')
subprocess.run('dotnet build', shell=True, cwd=projectPath)
subprocess.Popen('dotnet {}.dll --urls "http://*:{}"'.format(name,
port), shell=True, cwd=dllPath)
# start_service(
# name, 'dotnet build {}; dotnet {}.dll'.format(projectPath, dllPath))
# start_service(
# name, 'cd {0}; dotnet build; cd {1}; dotnet {2}.dll'.format(projectPath, dllPath, name))
# start_service(
# name, 'cd {};dotnet publish -o bin/Publish;cd bin/Publish;run {}.dll'.format(runPath, name))
......@@ -46,16 +58,16 @@ def start_dotnetservice(name, runPath):
def start_service(name, cmd):
print('启动 ' + name)
print('run cmd -> ' + cmd)
ret = subprocess.Popen(cmd)
# ret = subprocess.Popen(cmd)
ret = subprocess.Popen(cmd, shell=True)
# 记录下 pid
poutput(pid_output, "service {},pid {}".format(name, str(ret.pid)))
clear_poutput(pid_output)
print('启动 Consul')
start_service('Consul', 'consul agent -dev')
# start_service('Consul', 'consul agent -dev')
# d = os.system('consul agent -dev')
# d = os.popen('consul agent -dev')
......@@ -66,23 +78,28 @@ start_service('Consul', 'consul agent -dev')
# Gateway
s_name = 'Aurora.Gateway'
runPath = os.path.join(work_space)
start_dotnetservice(s_name, runPath)
start_dotnetservice(s_name, runPath, 5000)
# Tenant
s_name = 'Aurora.Tenant.Api'
runPath = os.path.join(work_space, 'Aurora.Microservices',
'Aurora.Tenant')
start_dotnetservice(s_name, runPath)
start_dotnetservice(s_name, runPath, 6000)
# Auth
s_name = 'Aurora.Auth'
runPath = os.path.join(work_space)
start_dotnetservice(s_name, runPath, 7000)
# Core.Api
s_name = 'Aurora.Core.Api'
runPath = os.path.join(work_space, 'Aurora.Microservices',
'Aurora.Core')
start_dotnetservice(s_name, runPath)
start_dotnetservice(s_name, runPath, 8000)
# WebHost
s_name = 'Aurora.WebHost'
runPath = os.path.join(work_space)
start_dotnetservice(s_name, runPath)
start_dotnetservice(s_name, runPath, 9000)
iStr = input('输入任意字符以结束……')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册