Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwplvx
Aurora
比较版本
58a641d71cae9944a2524c66e77c77f8fb4bffb3...80b38899d04fcb2063156ff5c1772ede5d5d4c36
Aurora
项目概览
lwplvx
/
Aurora
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Aurora
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
源分支
80b38899d04fcb2063156ff5c1772ede5d5d4c36
选择Git版本
...
目标分支
58a641d71cae9944a2524c66e77c77f8fb4bffb3
选择Git版本
比较
Commits (2)
https://gitcode.net/lwplvx/aurora/-/commit/230bd6ee611280b90cdf02771576a769164e4ae6
重命名 httpreports项目,增加run.py脚本
2021-07-07T18:15:11+08:00
lwplvx
lwplvx@yeah.net
https://gitcode.net/lwplvx/aurora/-/commit/80b38899d04fcb2063156ff5c1772ede5d5d4c36
启动参数 增加环境变量
2021-07-07T18:34:15+08:00
lwplvx
lwplvx@yeah.net
隐藏空白更改
内联
并排
Showing
14 changed file
with
138 addition
and
29 deletion
+138
-29
Aurora.Auth/Properties/launchSettings.json
Aurora.Auth/Properties/launchSettings.json
+1
-1
Aurora.Gateway/Properties/launchSettings.json
Aurora.Gateway/Properties/launchSettings.json
+1
-1
Aurora.HttpReports/Aurora.HttpReports.csproj
Aurora.HttpReports/Aurora.HttpReports.csproj
+0
-0
Aurora.HttpReports/Program.cs
Aurora.HttpReports/Program.cs
+1
-1
Aurora.HttpReports/Properties/launchSettings.json
Aurora.HttpReports/Properties/launchSettings.json
+2
-2
Aurora.HttpReports/Startup.cs
Aurora.HttpReports/Startup.cs
+1
-1
Aurora.HttpReports/appsettings.json
Aurora.HttpReports/appsettings.json
+0
-0
Aurora.Microservices/Aurora.Core/Aurora.Core.Api/Properties/launchSettings.json
...urora.Core/Aurora.Core.Api/Properties/launchSettings.json
+1
-1
Aurora.Microservices/Aurora.Core/Aurora.Core.Api/appsettings.json
...icroservices/Aurora.Core/Aurora.Core.Api/appsettings.json
+4
-4
Aurora.Microservices/Aurora.Tenant/Aurora.Tenant.Api/Properties/launchSettings.json
...a.Tenant/Aurora.Tenant.Api/Properties/launchSettings.json
+1
-1
Aurora.WebHost/Properties/launchSettings.json
Aurora.WebHost/Properties/launchSettings.json
+1
-1
Scripts/Deploy/buildrun.py
Scripts/Deploy/buildrun.py
+101
-0
Scripts/Deploy/run.py
Scripts/Deploy/run.py
+20
-16
blog-list.md
blog-list.md
+4
-0
未找到文件。
Aurora.Auth/Properties/launchSettings.json
浏览文件 @
80b38899
...
...
@@ -22,7 +22,7 @@
"dotnetRunMessages"
:
"true"
,
"launchBrowser"
:
true
,
"launchUrl"
:
"swagger"
,
"applicationUrl"
:
"http
s://localhost:5001;http://localhost:5
000"
,
"applicationUrl"
:
"http
://localhost:7
000"
,
"environmentVariables"
:
{
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
...
...
Aurora.Gateway/Properties/launchSettings.json
浏览文件 @
80b38899
...
...
@@ -22,7 +22,7 @@
"dotnetRunMessages"
:
"true"
,
"launchBrowser"
:
true
,
"launchUrl"
:
"swagger"
,
"applicationUrl"
:
"http://localhost:
6
000"
,
"applicationUrl"
:
"http://localhost:
5
000"
,
"environmentVariables"
:
{
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
...
...
Aurora.HttpRepo
ts/Aurora.HttpRepo
ts.csproj
→
Aurora.HttpRepo
rts/Aurora.HttpRepor
ts.csproj
浏览文件 @
80b38899
文件已移动
Aurora.HttpRepots/Program.cs
→
Aurora.HttpRepo
r
ts/Program.cs
浏览文件 @
80b38899
...
...
@@ -7,7 +7,7 @@ using Microsoft.Extensions.Configuration;
using
Microsoft.Extensions.Hosting
;
using
Microsoft.Extensions.Logging
;
namespace
Aurora.HttpRepots
namespace
Aurora.HttpRepo
r
ts
{
public
class
Program
{
...
...
Aurora.HttpRepots/Properties/launchSettings.json
→
Aurora.HttpRepo
r
ts/Properties/launchSettings.json
浏览文件 @
80b38899
...
...
@@ -15,11 +15,11 @@
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
},
"Aurora.HttpRepots"
:
{
"Aurora.HttpRepo
r
ts"
:
{
"commandName"
:
"Project"
,
"dotnetRunMessages"
:
"true"
,
"launchBrowser"
:
true
,
"applicationUrl"
:
"http://localhost:
70
00"
,
"applicationUrl"
:
"http://localhost:
91
00"
,
"environmentVariables"
:
{
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
...
...
Aurora.HttpRepots/Startup.cs
→
Aurora.HttpRepo
r
ts/Startup.cs
浏览文件 @
80b38899
...
...
@@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Http;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Hosting
;
namespace
Aurora.HttpRepots
namespace
Aurora.HttpRepo
r
ts
{
public
class
Startup
{
...
...
Aurora.HttpRepots/appsettings.json
→
Aurora.HttpRepo
r
ts/appsettings.json
浏览文件 @
80b38899
文件已移动
Aurora.Microservices/Aurora.Core/Aurora.Core.Api/Properties/launchSettings.json
浏览文件 @
80b38899
...
...
@@ -22,7 +22,7 @@
"dotnetRunMessages"
:
"true"
,
"launchBrowser"
:
true
,
"launchUrl"
:
"swagger"
,
"applicationUrl"
:
"http://localhost:
5
000"
,
"applicationUrl"
:
"http://localhost:
8
000"
,
"environmentVariables"
:
{
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
...
...
Aurora.Microservices/Aurora.Core/Aurora.Core.Api/appsettings.json
浏览文件 @
80b38899
...
...
@@ -7,8 +7,8 @@
}
},
"Service"
:
{
"Name"
:
"Aurora.Core.
ClientService
"
,
"Port"
:
"
5
000"
"Name"
:
"Aurora.Core.
Api
"
,
"Port"
:
"
8
000"
},
"Consul"
:
{
"IP"
:
"localhost"
,
...
...
@@ -31,11 +31,11 @@
},
"HttpReports"
:
{
"Transport"
:
{
"CollectorAddress"
:
"http://localhost:
70
00/"
,
"CollectorAddress"
:
"http://localhost:
91
00/"
,
"DeferSecond"
:
10
,
"DeferThreshold"
:
100
},
"Server"
:
"http://localhost:
5
000"
,
"Server"
:
"http://localhost:
8
000"
,
"Service"
:
"User"
,
"Switch"
:
true
,
"RequestFilter"
:
[
"/api/health/*"
,
"/HttpReports*"
],
...
...
Aurora.Microservices/Aurora.Tenant/Aurora.Tenant.Api/Properties/launchSettings.json
浏览文件 @
80b38899
...
...
@@ -22,7 +22,7 @@
"dotnetRunMessages"
:
"true"
,
"launchBrowser"
:
true
,
"launchUrl"
:
"swagger"
,
"applicationUrl"
:
"http://localhost:
5
000"
,
"applicationUrl"
:
"http://localhost:
6
000"
,
"environmentVariables"
:
{
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
...
...
Aurora.WebHost/Properties/launchSettings.json
浏览文件 @
80b38899
...
...
@@ -21,7 +21,7 @@
"dotnetRunMessages"
:
"true"
,
"launchBrowser"
:
true
,
"inspectUri"
:
"{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
,
"applicationUrl"
:
"http://localhost:
5001
"
,
"applicationUrl"
:
"http://localhost:
9000
"
,
"environmentVariables"
:
{
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
...
...
Scripts/Deploy/buildrun.py
0 → 100644
浏览文件 @
80b38899
import
os
import
signal
import
subprocess
work_space
=
'E:
\\
Workspace
\\
aurora'
pid_output
=
'p_output'
print
(
'work_space: '
+
work_space
)
print
(
'开始运行……'
)
def
kill_process
(
name
):
try
:
# iterating through each instance of the process
for
line
in
os
.
popen
(
"ps ax | grep "
+
name
+
" | grep -v grep"
):
fields
=
line
.
split
()
# extracting Process ID from the output
pid
=
fields
[
0
]
# terminating process
os
.
kill
(
int
(
pid
),
signal
.
SIGKILL
)
print
(
"Process {} Successfully terminated"
.
format
(
name
))
except
:
print
(
"Error Encountered while running script"
)
def
clear_poutput
(
name
):
# 定义函数名
b
=
os
.
getcwd
()
filePath
=
os
.
path
.
join
(
b
,
name
)
# 在当前py文件所在路径下的new文件中创建txt
with
open
(
filePath
,
'a+'
,
encoding
=
'utf-8'
)
as
f
:
f
.
truncate
(
0
)
def
poutput
(
name
,
pid
):
# 定义函数名
b
=
os
.
getcwd
()
filePath
=
os
.
path
.
join
(
b
,
name
)
# 在当前py文件所在路径下的new文件中创建txt
with
open
(
filePath
,
'a+'
)
as
f
:
f
.
write
(
pid
+
'
\n
'
)
# 加\n换行显示
# 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
):
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
)
poutput
(
pid_output
,
"service {},pid {}"
.
format
(
name
,
str
(
ret
.
pid
)))
def
start_service
(
name
,
cmd
):
print
(
'启动 '
+
name
)
print
(
'run cmd -> '
+
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'
)
# cmd 查看端口占用 netstat -aon|findstr "8500"
# cmd 杀死进程 taskkill /f /pid 18xx8
# Gateway
s_name
=
'Aurora.Gateway'
runPath
=
os
.
path
.
join
(
work_space
)
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
,
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
,
8000
)
# WebHost
s_name
=
'Aurora.WebHost'
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
)
iStr
=
input
(
'输入任意字符以结束……'
)
Scripts/Deploy/run.py
浏览文件 @
80b38899
...
...
@@ -39,20 +39,14 @@ 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
)
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))
# subprocess.run('dotnet build', shell=True, cwd=projectPath)
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
)))
def
start_service
(
name
,
cmd
):
...
...
@@ -67,13 +61,18 @@ def start_service(name, cmd):
clear_poutput
(
pid_output
)
print
(
'启动 Consul'
)
# start_service('Consul', 'consul agent -dev')
# d = os.system('consul agent -dev')
# d = os.popen('consul agent -dev')
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'
...
...
@@ -102,4 +101,9 @@ s_name = 'Aurora.WebHost'
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
)
iStr
=
input
(
'输入任意字符以结束……'
)
blog-list.md
浏览文件 @
80b38899
...
...
@@ -8,3 +8,7 @@
*
[
.NET Core微服务之基于Consul实现服务治理
](
https://www.cnblogs.com/edisonchou/p/9124985.html
)
*
[
8分钟学会Consul集群搭建及微服务概念
](
https://www.cnblogs.com/ZaraNet/p/10123291.html
)
*
[
httpreports 文档
](
https://www.yuque.com/httpreports/docs/azyxwc#KHHIP
)
自己写的 k8s 集群搭建方法放出来
搜索一个 Docker Desktop 安装k8s的方法