Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Sep 23, 2024
2 parents 398df8c + 9dcc23d commit e4e9ded
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 101 deletions.
7 changes: 4 additions & 3 deletions Stardust.Data/Deployment/Model.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,20 @@
<Table Name="AppDeployNode" Description="应用节点。应用部署集和节点服务器的依赖关系,一个应用可有多个部署集如arm和x64,在目标节点上发布该部署集对应的应用zip包">
<Columns>
<Column Name="Id" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
<Column Name="DeployName" DataType="String" Description="发布名。默认为空,使用部署集上名字。可用于单节点多发布场景" />
<Column Name="DeployId" ColumnName="AppId" DataType="Int32" Map="AppDeploy@Id@$" Description="应用部署集。对应AppDeploy" />
<Column Name="NodeId" DataType="Int32" Description="节点。节点服务器" />
<Column Name="IP" DataType="String" Description="IP地址。节点所在内网IP地址" />
<Column Name="Sort" DataType="Int32" Description="顺序。较小在前,同时表示延迟发布秒数" />
<Column Name="Enable" DataType="Boolean" Description="启用" />
<Column Name="Environment" DataType="String" Description="环境。prod/test/dev/uat等" Category="发布参数" />
<Column Name="FileName" DataType="String" Description="文件。应用启动文件,可直接使用zip包,支持差异定制,为空时使用应用集配置" Category="发布参数" />
<Column Name="Arguments" DataType="String" Length="500" Description="参数。启动应用的参数,为空时使用应用集配置" Category="发布参数" />
<Column Name="WorkingDirectory" DataType="String" Length="200" Description="工作目录。应用根目录,为空时使用应用集配置" Category="发布参数" />
<Column Name="Environments" DataType="String" Length="500" Description="环境变量。启动应用前设置的环境变量" Category="发布参数" />
<Column Name="Mode" DataType="Int32" Description="工作模式。0默认exe/zip;1仅解压;2解压后运行;3仅运行一次;4多实例exe/zip。为空时使用应用集配置" Type="Stardust.Models.ServiceModes" Category="发布参数" />
<Column Name="Delay" DataType="Int32" Description="延迟。批量发布时,需要延迟执行的时间,用于滚动发布,单位秒" Category="发布参数" />
<Column Name="ProcessId" DataType="Int32" Description="进程" Category="状态" />
<Column Name="ProcessName" DataType="String" Length="200" Description="进程名称" Category="状态" />
<Column Name="UserName" DataType="String" Description="用户名。启动该进程的用户名" Category="状态" />
<Column Name="ProcessName" DataType="String" Length="200" Description="进程名称" Category="状态" />
<Column Name="StartTime" DataType="DateTime" Description="进程时间" Category="状态" />
<Column Name="Version" DataType="String" Description="版本。客户端" Category="状态" />
<Column Name="Compile" DataType="DateTime" Description="编译时间。客户端" Category="状态" />
Expand Down
69 changes: 40 additions & 29 deletions Stardust.Data/Deployment/Stardust.htm
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,17 @@ <h3>应用节点(AppDeployNode)</h3>
<td></td>
</tr>

<tr>
<td>DeployName</td>
<td>发布名</td>
<td>String</td>
<td>50</td>
<td></td>
<td></td>
<td></td>
<td>默认为空,使用部署集上名字。可用于单节点多发布场景</td>
</tr>

<tr>
<td>AppId</td>
<td>应用部署集</td>
Expand Down Expand Up @@ -462,17 +473,6 @@ <h3>应用节点(AppDeployNode)</h3>
<td>节点所在内网IP地址</td>
</tr>

<tr>
<td>Sort</td>
<td>顺序</td>
<td>Int32</td>
<td></td>
<td></td>
<td></td>
<td>N</td>
<td>较小在前,同时表示延迟发布秒数</td>
</tr>

<tr>
<td>Enable</td>
<td>启用</td>
Expand All @@ -484,17 +484,6 @@ <h3>应用节点(AppDeployNode)</h3>
<td></td>
</tr>

<tr>
<td>Environment</td>
<td>环境</td>
<td>String</td>
<td>50</td>
<td></td>
<td></td>
<td></td>
<td>prod/test/dev/uat等</td>
</tr>

<tr>
<td>FileName</td>
<td>文件</td>
Expand Down Expand Up @@ -528,6 +517,17 @@ <h3>应用节点(AppDeployNode)</h3>
<td>应用根目录,为空时使用应用集配置</td>
</tr>

<tr>
<td>Environments</td>
<td>环境变量</td>
<td>String</td>
<td>500</td>
<td></td>
<td></td>
<td></td>
<td>启动应用前设置的环境变量</td>
</tr>

<tr>
<td>Mode</td>
<td>工作模式</td>
Expand All @@ -540,24 +540,24 @@ <h3>应用节点(AppDeployNode)</h3>
</tr>

<tr>
<td>ProcessId</td>
<td>进程</td>
<td>Delay</td>
<td>延迟</td>
<td>Int32</td>
<td></td>
<td></td>
<td></td>
<td>N</td>
<td></td>
<td>批量发布时,需要延迟执行的时间,用于滚动发布,单位秒</td>
</tr>

<tr>
<td>ProcessName</td>
<td>进程名称</td>
<td>String</td>
<td>200</td>
<td>ProcessId</td>
<td>进程</td>
<td>Int32</td>
<td></td>
<td></td>
<td></td>
<td>N</td>
<td></td>
</tr>

Expand All @@ -572,6 +572,17 @@ <h3>应用节点(AppDeployNode)</h3>
<td>启动该进程的用户名</td>
</tr>

<tr>
<td>ProcessName</td>
<td>进程名称</td>
<td>String</td>
<td>200</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>

<tr>
<td>StartTime</td>
<td>进程时间</td>
Expand Down
4 changes: 3 additions & 1 deletion Stardust.Data/Deployment/应用节点.Biz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,10 @@ public ServiceInfo ToService(AppDeploy app)

var inf = new ServiceInfo
{
Name = app.Name,
Name = DeployName,
FileName = FileName,
Arguments = Arguments,
Environments = Environments,
WorkingDirectory = WorkingDirectory,

Enable = app.Enable && Enable,
Expand All @@ -187,6 +188,7 @@ public ServiceInfo ToService(AppDeploy app)
MaxMemory = app.MaxMemory,
Mode = Mode,
};
if (inf.Name.IsNullOrEmpty()) inf.Name = app.Name;
if (inf.FileName.IsNullOrEmpty()) inf.FileName = app.FileName;
if (inf.Arguments.IsNullOrEmpty()) inf.Arguments = app.Arguments;
if (inf.Environments.IsNullOrEmpty()) inf.Environments = app.Environments;
Expand Down
Loading

0 comments on commit e4e9ded

Please sign in to comment.