feat: declare and execute SCUM guided installs
This commit is contained in:
@@ -42,6 +42,15 @@ func scumDeploymentPlan(plugin domain.GamePlugin, definition domain.ServerDeploy
|
||||
if strings.TrimSpace(profile.Key) == "" || strings.TrimSpace(profile.Version) == "" || profile.SteamAppID == "" {
|
||||
return nil, validationError("SCUM deployment template is incomplete")
|
||||
}
|
||||
expectedPrerequisites := map[string]string{"steamcmd": "steamcmd", "vcredist-2012-x86": "windows-vcredist", "vcredist-2012-x64": "windows-vcredist", "vcredist-2013-x86": "windows-vcredist", "vcredist-2013-x64": "windows-vcredist", "vcredist-2015-2022-x86": "windows-vcredist", "vcredist-2015-2022-x64": "windows-vcredist", "directx-jun2010": "windows-directx"}
|
||||
if len(profile.Prerequisites) != len(expectedPrerequisites) {
|
||||
return nil, validationError("SCUM deployment template prerequisite list is incomplete")
|
||||
}
|
||||
for _, prerequisite := range profile.Prerequisites {
|
||||
if expectedPrerequisites[prerequisite.Key] != prerequisite.Kind {
|
||||
return nil, validationError("SCUM deployment template prerequisite is invalid")
|
||||
}
|
||||
}
|
||||
fieldKeys := make(map[string]struct{}, len(plugin.CreateFields))
|
||||
for _, field := range plugin.CreateFields {
|
||||
fieldKeys[field.Key] = struct{}{}
|
||||
@@ -70,6 +79,7 @@ func scumDeploymentPlan(plugin domain.GamePlugin, definition domain.ServerDeploy
|
||||
InstallRootKey: profile.InstallRootKey,
|
||||
ConfigKey: profile.ConfigKey,
|
||||
ConfigFormat: profile.ConfigFormat,
|
||||
Prerequisites: append([]domain.RuntimeServerPrerequisite(nil), profile.Prerequisites...),
|
||||
ConfigMappings: append([]domain.RuntimeServerConfigMapping(nil), profile.ConfigMappings...),
|
||||
DiscoveryMarkers: append([]domain.RuntimeServerDiscoveryMarker(nil), profile.DiscoveryMarkers...),
|
||||
VerificationChecks: append([]domain.RuntimeServerVerificationCheck(nil), profile.VerificationChecks...),
|
||||
|
||||
Reference in New Issue
Block a user