Fix SCUM generated run deployment flow

This commit is contained in:
npc0-hue
2026-07-31 14:10:30 +08:00
parent 6d71d8d232
commit f23d18ea57
11 changed files with 291 additions and 35 deletions
+18
View File
@@ -24,6 +24,24 @@ func scumDeploymentTestPlugin() domain.GamePlugin {
}
}
func requireManualSCUMRuntimeBindings(plugin *domain.GamePlugin, profileKey string) {
plugin.RuntimeProfiles.Discovery = []domain.RuntimeDiscoveryProbe{
{Key: "steamcmd", Kind: "command.version", TargetKey: "steamcmd", Required: true},
{Key: "scum-install", Kind: "file.exists", TargetKey: "server/install-root", Required: true, Platforms: []string{"windows"}},
}
plugin.RuntimeProfiles.DependencyProbes = []domain.RuntimeDependencyProbe{{Key: "steamcmd", Kind: "command.version", TargetKey: "steamcmd", Required: true, Platforms: []string{"windows"}}}
plugin.RuntimeProfiles.LogSources = []domain.RuntimeLogSource{
{Key: "scum-console-stdout", Kind: "process.stdout", TargetKey: "scum/server-process", StreamKey: "scum.console.stdout", CursorKind: "sequence", RetentionDays: 30},
{Key: "scum-server-events", Kind: "file.tail", TargetKey: "logs/server", StreamKey: "scum.server", CursorKind: "fingerprint", RetentionDays: 90},
}
plugin.RuntimeProfiles.TransportProfiles = []domain.RuntimeTransportProfile{{Key: "server-files", Kind: "file", TargetKey: "server-root", Capabilities: []string{domain.JobCapabilityRemoteRunFilesRead, domain.JobCapabilityRemoteRunFilesWrite}}}
for i := range plugin.RuntimeProfiles.LifecycleProfiles {
if plugin.RuntimeProfiles.LifecycleProfiles[i].Key == profileKey {
plugin.RuntimeProfiles.LifecycleProfiles[i].TransportKeys = []string{"server-files"}
}
}
}
func TestSCUMDeploymentPlanSeparatesInstallAndAdopt(t *testing.T) {
plugin := scumDeploymentTestPlugin()
definition := domain.ServerDeploymentDefinition{Mode: domain.ServerDeploymentModeGuided, CreateInputs: map[string]string{"serverName": "Alpha", "gamePort": "7777", "queryPort": "27015", "maxPlayers": "64"}}