@@ -27,12 +27,11 @@ public Task<GetSystemInfoResponse> Handle(GetSystemInfoRequest request, Cancella
2727 systeminfocomponents . Add ( new SystemInfoComponentEntryDto ( assem . ManifestModule . Name . ToString ( ) , assem . ToString ( ) ) ) ;
2828 }
2929
30- // TODO: is it possible to make that better?
3130 systeminfoversions . Add ( new SystemInfoVersionEntryDto ( "NETEVENT" , Assembly . GetEntryAssembly ( ) ? . GetCustomAttribute < AssemblyInformationalVersionAttribute > ( ) ? . InformationalVersion ) ) ;
32- systeminfoversions . Add ( new SystemInfoVersionEntryDto ( "BUILDNODE" , string . IsNullOrEmpty ( Environment . GetEnvironmentVariable ( "BUILDNODE" ) ) ? "dev" : Environment . GetEnvironmentVariable ( "BUILDNODE" ) ) ) ;
33- systeminfoversions . Add ( new SystemInfoVersionEntryDto ( "BUILDID" , string . IsNullOrEmpty ( Environment . GetEnvironmentVariable ( "BUILDID" ) ) ? "dev" : Environment . GetEnvironmentVariable ( "BUILDNODE" ) ) ) ;
34- systeminfoversions . Add ( new SystemInfoVersionEntryDto ( "BUILDNUMBER" , string . IsNullOrEmpty ( Environment . GetEnvironmentVariable ( "BUILDNUMBER" ) ) ? "dev" : Environment . GetEnvironmentVariable ( "BUILDNODE" ) ) ) ;
35- systeminfoversions . Add ( new SystemInfoVersionEntryDto ( "SOURCE_COMMIT" , string . IsNullOrEmpty ( Environment . GetEnvironmentVariable ( "SOURCE_COMMIT" ) ) ? "dev" : Environment . GetEnvironmentVariable ( "BUILDNODE" ) ) ) ;
31+ systeminfoversions . Add ( CreateSystemInfoVersionEntryFromEnv ( "BUILDNODE" ) ) ;
32+ systeminfoversions . Add ( CreateSystemInfoVersionEntryFromEnv ( "BUILDID" ) ) ;
33+ systeminfoversions . Add ( CreateSystemInfoVersionEntryFromEnv ( "BUILDNUMBER" ) ) ;
34+ systeminfoversions . Add ( CreateSystemInfoVersionEntryFromEnv ( "SOURCE_COMMIT" ) ) ;
3635
3736 // TODO: think about healthchecks and healthcheck modularity (to perform checks on various services like game servers, the mail server, payment apis ...) and remove dummy services
3837 systeminfohealth . Add ( new SystemInfoHealthEntryDto ( "NETEVENT Server" , string . Empty , true ) ) ;
@@ -42,5 +41,10 @@ public Task<GetSystemInfoResponse> Handle(GetSystemInfoRequest request, Cancella
4241
4342 return Task . FromResult ( new GetSystemInfoResponse ( systeminfo ) ) ;
4443 }
44+
45+ private static SystemInfoVersionEntryDto CreateSystemInfoVersionEntryFromEnv ( string envName )
46+ {
47+ return new SystemInfoVersionEntryDto ( envName , string . IsNullOrEmpty ( Environment . GetEnvironmentVariable ( envName ) ) ? "dev" : Environment . GetEnvironmentVariable ( envName ) ) ;
48+ }
4549 }
4650}
0 commit comments