提交 80b38899 编写于 作者: lwplvx's avatar lwplvx

启动参数 增加环境变量

上级 230bd6ee
......@@ -94,8 +94,8 @@ runPath = os.path.join(work_space)
start_dotnetservice(s_name, runPath, 9000)
# HttpReports
# s_name = 'Aurora.HttpReports'
# runPath = os.path.join(work_space)
# start_dotnetservice(s_name, runPath, 9100)
s_name = 'Aurora.HttpReports'
runPath = os.path.join(work_space)
start_dotnetservice(s_name, runPath, 9100)
iStr = input('输入任意字符以结束……')
......@@ -39,13 +39,13 @@ def poutput(name, pid): # 定义函数名
# 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):
def start_dotnetservice(name, runPath, port,env='Development'):
print('启动 ' + name)
projectPath = os.path.join(runPath, name)
dllPath = os.path.join(projectPath, r'bin\Debug\net5.0')
# subprocess.run('dotnet build', shell=True, cwd=projectPath)
ret = subprocess.Popen('dotnet {}.dll --urls "http://*:{}"'.format(name,
port), shell=True, cwd=dllPath)
ret = subprocess.Popen('dotnet {}.dll --urls "http://*:{}" --environment {} '.format(name,
port,env), shell=True, cwd=dllPath)
poutput(pid_output, "service {},pid {}".format(name, str(ret.pid)))
......@@ -65,6 +65,14 @@ start_service('Consul', 'consul agent -dev')
# cmd 查看端口占用 netstat -aon|findstr "8500"
# cmd 杀死进程 taskkill /f /pid 18xx8
# dotnet run --launch-profile "SampleApp"
# 设置环境变量 Windows 命令行:
# setx ASPNETCORE_ENVIRONMENT "Development"
# 设置环境变量 PowerShell命令:
# $Env:ASPNETCORE_ENVIRONMENT = "Development"
# MacOS/Linux
# export ASPNETCORE_ENVIRONMENT=development
# Gateway
s_name = 'Aurora.Gateway'
......@@ -94,8 +102,8 @@ runPath = os.path.join(work_space)
start_dotnetservice(s_name, runPath, 9000)
# HttpReports
# s_name = 'Aurora.HttpReports'
# runPath = os.path.join(work_space)
# start_dotnetservice(s_name, runPath, 9100)
s_name = 'Aurora.HttpReports'
runPath = os.path.join(work_space)
start_dotnetservice(s_name, runPath, 9100)
iStr = input('输入任意字符以结束……')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册