fix(docker,cli): add LmxProxy.Client to Docker build, fix set-bindings JSON parsing
Docker: include lmxproxy/src/ZB.MOM.WW.LmxProxy.Client in build context so the project reference resolves during container image build. CLI: fix set-bindings JSON parsing — use JsonElement.GetString()/GetInt32() instead of object.ToString() which returned null for deserialized elements.
This commit is contained in:
@@ -21,14 +21,16 @@ COPY src/ScadaLink.ClusterInfrastructure/ScadaLink.ClusterInfrastructure.csproj
|
|||||||
COPY src/ScadaLink.InboundAPI/ScadaLink.InboundAPI.csproj src/ScadaLink.InboundAPI/
|
COPY src/ScadaLink.InboundAPI/ScadaLink.InboundAPI.csproj src/ScadaLink.InboundAPI/
|
||||||
COPY src/ScadaLink.ConfigurationDatabase/ScadaLink.ConfigurationDatabase.csproj src/ScadaLink.ConfigurationDatabase/
|
COPY src/ScadaLink.ConfigurationDatabase/ScadaLink.ConfigurationDatabase.csproj src/ScadaLink.ConfigurationDatabase/
|
||||||
COPY src/ScadaLink.ManagementService/ScadaLink.ManagementService.csproj src/ScadaLink.ManagementService/
|
COPY src/ScadaLink.ManagementService/ScadaLink.ManagementService.csproj src/ScadaLink.ManagementService/
|
||||||
|
COPY lmxproxy/src/ZB.MOM.WW.LmxProxy.Client/ZB.MOM.WW.LmxProxy.Client.csproj lmxproxy/src/ZB.MOM.WW.LmxProxy.Client/
|
||||||
|
|
||||||
# Restore NuGet packages via Host project (follows ProjectReferences to all 17 dependencies)
|
# Restore NuGet packages via Host project (follows ProjectReferences to all dependencies)
|
||||||
# This layer is cached until any .csproj changes — source-only changes skip restore entirely
|
# This layer is cached until any .csproj changes — source-only changes skip restore entirely
|
||||||
RUN dotnet restore src/ScadaLink.Host/ScadaLink.Host.csproj
|
RUN dotnet restore src/ScadaLink.Host/ScadaLink.Host.csproj
|
||||||
|
|
||||||
# Stage 2: Build + Publish
|
# Stage 2: Build + Publish
|
||||||
FROM restore AS build
|
FROM restore AS build
|
||||||
COPY src/ src/
|
COPY src/ src/
|
||||||
|
COPY lmxproxy/src/ZB.MOM.WW.LmxProxy.Client/ lmxproxy/src/ZB.MOM.WW.LmxProxy.Client/
|
||||||
RUN dotnet publish src/ScadaLink.Host/ScadaLink.Host.csproj \
|
RUN dotnet publish src/ScadaLink.Host/ScadaLink.Host.csproj \
|
||||||
-c Release -o /app/publish
|
-c Release -o /app/publish
|
||||||
|
|
||||||
|
|||||||
@@ -51,10 +51,10 @@ public static class InstanceCommands
|
|||||||
{
|
{
|
||||||
var id = result.GetValue(idOption);
|
var id = result.GetValue(idOption);
|
||||||
var bindingsJson = result.GetValue(bindingsOption)!;
|
var bindingsJson = result.GetValue(bindingsOption)!;
|
||||||
var pairs = System.Text.Json.JsonSerializer.Deserialize<List<List<object>>>(bindingsJson)
|
var pairs = System.Text.Json.JsonSerializer.Deserialize<List<List<System.Text.Json.JsonElement>>>(bindingsJson)
|
||||||
?? throw new InvalidOperationException("Invalid bindings JSON");
|
?? throw new InvalidOperationException("Invalid bindings JSON");
|
||||||
var bindings = pairs.Select(p =>
|
var bindings = pairs.Select(p =>
|
||||||
(p[0].ToString()!, int.Parse(p[1].ToString()!))).ToList();
|
(p[0].GetString()!, p[1].GetInt32())).ToList();
|
||||||
return await CommandHelpers.ExecuteCommandAsync(
|
return await CommandHelpers.ExecuteCommandAsync(
|
||||||
result, urlOption, formatOption, usernameOption, passwordOption,
|
result, urlOption, formatOption, usernameOption, passwordOption,
|
||||||
new SetConnectionBindingsCommand(id, bindings));
|
new SetConnectionBindingsCommand(id, bindings));
|
||||||
|
|||||||
Reference in New Issue
Block a user