mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-09 13:28:39 +00:00
configurable envver
This commit is contained in:
parent
04f34eaccc
commit
dc81d8fceb
3 changed files with 7 additions and 5 deletions
|
@ -3,4 +3,6 @@ namespace LBPUnion.ProjectLighthouse.Configuration.ConfigurationCategories;
|
||||||
public class CustomizationConfiguration
|
public class CustomizationConfiguration
|
||||||
{
|
{
|
||||||
public string ServerName { get; set; } = "Project Lighthouse";
|
public string ServerName { get; set; } = "Project Lighthouse";
|
||||||
|
public string EnvironmentName { get; set; } = "lighthouse";
|
||||||
|
public bool UseNumericRevisionNumber { get; set; } = false;
|
||||||
}
|
}
|
|
@ -23,7 +23,7 @@ public class ServerConfiguration
|
||||||
// You can use an ObsoleteAttribute instead. Make sure you set it to error, though.
|
// You can use an ObsoleteAttribute instead. Make sure you set it to error, though.
|
||||||
//
|
//
|
||||||
// Thanks for listening~
|
// Thanks for listening~
|
||||||
public const int CurrentConfigVersion = 8;
|
public const int CurrentConfigVersion = 9;
|
||||||
|
|
||||||
#region Meta
|
#region Meta
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,12 @@ public static class VersionHelper
|
||||||
{
|
{
|
||||||
static VersionHelper()
|
static VersionHelper()
|
||||||
{
|
{
|
||||||
|
string rawRevision = "<unknown>";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CommitHash = ResourceHelper.ReadManifestFile("gitVersion.txt");
|
CommitHash = ResourceHelper.ReadManifestFile("gitVersion.txt");
|
||||||
Branch = ResourceHelper.ReadManifestFile("gitBranch.txt");
|
Branch = ResourceHelper.ReadManifestFile("gitBranch.txt");
|
||||||
string rawRevision = ResourceHelper.ReadManifestFile("gitRevCount.txt");
|
rawRevision = ServerConfiguration.Instance.Customization.UseNumericRevisionNumber ? ResourceHelper.ReadManifestFile("gitRevCount.txt") : $"{CommitHash}_{Build}";
|
||||||
Revision = (Branch == "main") ? $"r{rawRevision}" : $"{Branch}_r{rawRevision}";
|
Revision = (Branch == "main") ? $"r{rawRevision}" : $"{Branch}_r{rawRevision}";
|
||||||
|
|
||||||
string remotesFile = ResourceHelper.ReadManifestFile("gitRemotes.txt");
|
string remotesFile = ResourceHelper.ReadManifestFile("gitRemotes.txt");
|
||||||
|
@ -50,7 +51,6 @@ public static class VersionHelper
|
||||||
"Please make sure you are properly disclosing the source code to any users who may be using this instance.",
|
"Please make sure you are properly disclosing the source code to any users who may be using this instance.",
|
||||||
LogArea.Startup
|
LogArea.Startup
|
||||||
);
|
);
|
||||||
string rawRevision = ResourceHelper.ReadManifestFile("gitRevCount.txt");
|
|
||||||
Revision = $"{Branch}-dirty_r{rawRevision}";
|
Revision = $"{Branch}-dirty_r{rawRevision}";
|
||||||
CanCheckForUpdates = false;
|
CanCheckForUpdates = false;
|
||||||
}
|
}
|
||||||
|
@ -59,8 +59,8 @@ public static class VersionHelper
|
||||||
public static string CommitHash { get; set; }
|
public static string CommitHash { get; set; }
|
||||||
public static string Branch { get; set; }
|
public static string Branch { get; set; }
|
||||||
public static string Revision { get; set; }
|
public static string Revision { get; set; }
|
||||||
public static string FullVersion => $"Project Lighthouse {Branch}@{CommitHash} {Build} ({ServerConfiguration.Instance.Customization.ServerName} {Revision})";
|
public static string EnvVer => $"{ServerConfiguration.Instance.Customization.EnvironmentName} {Revision}";
|
||||||
public static string EnvVer => $"{ServerConfiguration.Instance.Customization.ServerName} {Revision}";
|
public static string FullVersion => $"Project Lighthouse {Branch}@{CommitHash} {Build} ({EnvVer})";
|
||||||
public static bool IsDirty => CommitHash.EndsWith("-dirty") || CommitsOutOfDate != 1 || CommitHash == "invalid" || Branch == "invalid";
|
public static bool IsDirty => CommitHash.EndsWith("-dirty") || CommitsOutOfDate != 1 || CommitHash == "invalid" || Branch == "invalid";
|
||||||
public static int CommitsOutOfDate { get; set; }
|
public static int CommitsOutOfDate { get; set; }
|
||||||
public static bool CanCheckForUpdates { get; set; }
|
public static bool CanCheckForUpdates { get; set; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue