Fix app startup and enable Sonic ESB restart via remote CMD.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -32,22 +32,55 @@ public sealed class PreflightValidator
|
||||
|
||||
foreach (DeploymentTarget target in selectedTargets)
|
||||
{
|
||||
ValidateTarget(result, target);
|
||||
ValidateTarget(result, target, requireDeployPaths: true);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void ValidateTarget(PreflightValidationResult result, DeploymentTarget target)
|
||||
/// <summary>
|
||||
/// Vorabprüfung nur für ESB-Neustart (ohne Zertifikat / Kopierpfade).
|
||||
/// </summary>
|
||||
public PreflightValidationResult ValidateRestartOnly(IReadOnlyList<DeploymentTarget> selectedTargets)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(target.TargetDirectory))
|
||||
PreflightValidationResult result = new();
|
||||
|
||||
if (selectedTargets.Count == 0)
|
||||
{
|
||||
AddIssue(result, $"Ziel '{target.Name}': TargetDirectory fehlt.", target.Id);
|
||||
AddIssue(result, "Bitte mindestens ein Ziel anhaken.");
|
||||
return result;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(target.CertificateFileName))
|
||||
foreach (DeploymentTarget target in selectedTargets)
|
||||
{
|
||||
AddIssue(result, $"Ziel '{target.Name}': CertificateFileName fehlt.", target.Id);
|
||||
if (target.RestartType is RestartType.None)
|
||||
{
|
||||
AddIssue(result, $"Ziel '{target.Name}': RestartType=None – kein Neustart konfiguriert.", target.Id);
|
||||
continue;
|
||||
}
|
||||
|
||||
ValidateTarget(result, target, requireDeployPaths: false);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void ValidateTarget(
|
||||
PreflightValidationResult result,
|
||||
DeploymentTarget target,
|
||||
bool requireDeployPaths)
|
||||
{
|
||||
if (requireDeployPaths)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(target.TargetDirectory))
|
||||
{
|
||||
AddIssue(result, $"Ziel '{target.Name}': TargetDirectory fehlt.", target.Id);
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(target.CertificateFileName))
|
||||
{
|
||||
AddIssue(result, $"Ziel '{target.Name}': CertificateFileName fehlt.", target.Id);
|
||||
}
|
||||
}
|
||||
|
||||
if (target.RestartType == RestartType.Command
|
||||
@@ -75,7 +108,7 @@ public sealed class PreflightValidator
|
||||
AddIssue(result, $"Ziel '{target.Name}': XapiSourcePath fehlt bei RestartType=SonicContainerWithXapi.", target.Id);
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(target.TargetDirectory))
|
||||
if (!requireDeployPaths || string.IsNullOrWhiteSpace(target.TargetDirectory))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user