mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 07:04:57 +01:00
Merge branch 'dev' of https://github.com/tgstation/tgstation-server into 886-FixWindowsWatchdog
This commit is contained in:
+1
-1
@@ -100,7 +100,7 @@ deploy:
|
||||
secure: lJNGAXwiB5HlWdthz3K4PetqpTG5IEAyRgKaiKxFMQ8HW8CcOjRtB97B05op7BsK
|
||||
artifact: ServerConsole,ServerService,ServerUpdatePackage,DMAPI,SwaggerSpec
|
||||
draft: $(TGSDraftNotes)
|
||||
prerelease: true
|
||||
prerelease: false
|
||||
on:
|
||||
TGSDeploy: "Do it."
|
||||
- provider: GitHub
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<TgsCoreVersion>4.1.0</TgsCoreVersion>
|
||||
<TgsApiVersion>6.1.0</TgsApiVersion>
|
||||
<TgsClientVersion>6.0.0</TgsClientVersion>
|
||||
<TgsDmapiVersion>5.0.0</TgsDmapiVersion>
|
||||
<TgsDmapiVersion>5.1.0</TgsDmapiVersion>
|
||||
<TgsControlPanelVersion>0.4.0</TgsControlPanelVersion>
|
||||
<TgsHostWatchdogVersion>1.1.0</TgsHostWatchdogVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
+6
-5
@@ -1,6 +1,6 @@
|
||||
//tgstation-server DMAPI
|
||||
|
||||
#define TGS_DMAPI_VERSION "5.0.0"
|
||||
#define TGS_DMAPI_VERSION "5.1.0"
|
||||
|
||||
//All functions and datums outside this document are subject to change with any version and should not be relied on
|
||||
|
||||
@@ -52,8 +52,9 @@
|
||||
|
||||
//EVENT CODES
|
||||
|
||||
#define TGS_EVENT_PORT_SWAP -2 //before a port change is about to happen, extra parameter is new port
|
||||
#define TGS_EVENT_REBOOT_MODE_CHANGE -1 //before a reboot mode change, extras parameters are the current and new reboot mode enums
|
||||
#define TGS_EVENT_REBOOT_MODE_CHANGE -1 //Before a reboot mode change, extras parameters are the current and new reboot mode enums
|
||||
#define TGS_EVENT_PORT_SWAP -2 //Before a port change is about to happen, extra parameters is new port
|
||||
#define TGS_EVENT_INSTANCE_RENAMED -3 //Before the instance is renamed, extra prameter is the new name
|
||||
|
||||
//See the descriptions for the parameters of these codes here: https://github.com/tgstation/tgstation-server/blob/master/src/Tgstation.Server.Host/Components/EventType.cs
|
||||
#define TGS_EVENT_REPO_RESET_ORIGIN 0
|
||||
@@ -67,9 +68,9 @@
|
||||
#define TGS_EVENT_COMPILE_START 8
|
||||
#define TGS_EVENT_COMPILE_CANCELLED 9
|
||||
#define TGS_EVENT_COMPILE_FAILURE 10
|
||||
#define TGS_EVENT_COMPILE_COMPLETE 11
|
||||
#define TGS_EVENT_COMPILE_COMPLETE 11 // Note, this event fires before the new .dmb is loaded into the watchdog. Consider using the TGS_EVENT_DEPLOYMENT_COMPLETE instead
|
||||
#define TGS_EVENT_INSTANCE_AUTO_UPDATE_START 12
|
||||
#define TGS_EVENT_REPO_MERGE_CONFLICT 13
|
||||
#define TGS_EVENT_DEPLOYMENT_COMPLETE 13
|
||||
|
||||
//OTHER ENUMS
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
var/datum/tgs_event_handler/event_handler
|
||||
|
||||
/datum/tgs_api/v5/ApiVersion()
|
||||
return new /datum/tgs_version("5.0.0")
|
||||
return new /datum/tgs_version("5.1.0")
|
||||
|
||||
/datum/tgs_api/v5/OnWorldNew(datum/tgs_event_handler/event_handler, minimum_required_security_level)
|
||||
src.event_handler = event_handler
|
||||
@@ -178,6 +178,9 @@
|
||||
if(!istext(new_instance_name))
|
||||
return TopicResponse("Invalid or missing [DMAPI5_TOPIC_PARAMETER_NEW_INSTANCE_NAME]!")
|
||||
|
||||
if(event_handler != null)
|
||||
event_handler.HandleEvent(TGS_EVENT_INSTANCE_RENAMED, new_instance_name)
|
||||
|
||||
instance_name = new_instance_name
|
||||
return TopicResponse()
|
||||
if(DMAPI5_TOPIC_COMMAND_CHAT_CHANNELS_UPDATE)
|
||||
|
||||
@@ -444,7 +444,7 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
|
||||
await Task.WhenAll(symATask, symBTask).ConfigureAwait(false);
|
||||
|
||||
await chatManager.SendUpdateMessage(String.Format(CultureInfo.InvariantCulture, "Deployment complete!{0}", watchdog.Running ? " Changes will be applied on next server reboot." : String.Empty), cancellationToken).ConfigureAwait(false);
|
||||
await chatManager.SendUpdateMessage(String.Format(CultureInfo.InvariantCulture, "Deployment complete! Changes will be applied {0}.", watchdog.DeploymentApplicationTime), cancellationToken).ConfigureAwait(false);
|
||||
|
||||
logger.LogDebug("Compile complete!");
|
||||
}
|
||||
|
||||
@@ -8,71 +8,76 @@
|
||||
/// <summary>
|
||||
/// Parameters: Reference name, commit sha
|
||||
/// </summary>
|
||||
RepoResetOrigin = 0,
|
||||
RepoResetOrigin,
|
||||
|
||||
/// <summary>
|
||||
/// Parameters: Checkout target
|
||||
/// </summary>
|
||||
RepoCheckout = 1,
|
||||
RepoCheckout,
|
||||
|
||||
/// <summary>
|
||||
/// No parameters
|
||||
/// </summary>
|
||||
RepoFetch = 2,
|
||||
RepoFetch,
|
||||
|
||||
/// <summary>
|
||||
/// Parameters: Pull request number, pull request sha, merger message
|
||||
/// </summary>
|
||||
RepoMergePullRequest = 3,
|
||||
RepoMergePullRequest,
|
||||
|
||||
/// <summary>
|
||||
/// Parameters: Absolute path to repository root
|
||||
/// </summary>
|
||||
RepoPreSynchronize = 4,
|
||||
RepoPreSynchronize,
|
||||
|
||||
/// <summary>
|
||||
/// Parameters: Version being installed
|
||||
/// </summary>
|
||||
ByondInstallStart = 5,
|
||||
ByondInstallStart,
|
||||
|
||||
/// <summary>
|
||||
/// Parameters: Error string
|
||||
/// </summary>
|
||||
ByondInstallFail = 6,
|
||||
ByondInstallFail,
|
||||
|
||||
/// <summary>
|
||||
/// Parameters: Old active version, new active version
|
||||
/// </summary>
|
||||
ByondActiveVersionChange = 7,
|
||||
ByondActiveVersionChange,
|
||||
|
||||
/// <summary>
|
||||
/// Parameters: Game directory path, origin commit sha
|
||||
/// </summary>
|
||||
CompileStart = 8,
|
||||
CompileStart,
|
||||
|
||||
/// <summary>
|
||||
/// No parameters
|
||||
/// </summary>
|
||||
CompileCancelled = 9,
|
||||
CompileCancelled,
|
||||
|
||||
/// <summary>
|
||||
/// Parameters: Game directory path, "1" if compile succeeded and api validation failed, "0" otherwise
|
||||
/// </summary>
|
||||
CompileFailure = 10,
|
||||
CompileFailure,
|
||||
|
||||
/// <summary>
|
||||
/// Parameters: Game directory path
|
||||
/// </summary>
|
||||
CompileComplete = 11,
|
||||
CompileComplete,
|
||||
|
||||
/// <summary>
|
||||
/// No parameters
|
||||
/// </summary>
|
||||
InstanceAutoUpdateStart = 12,
|
||||
InstanceAutoUpdateStart,
|
||||
|
||||
/// <summary>
|
||||
/// Parameters: Base sha, target sha, base reference, target reference
|
||||
/// </summary>
|
||||
RepoMergeConflict = 13,
|
||||
RepoMergeConflict,
|
||||
|
||||
/// <summary>
|
||||
/// No parameters
|
||||
/// </summary>
|
||||
DeploymentComplete
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +256,11 @@ namespace Tgstation.Server.Host.Components
|
||||
|
||||
databaseContext.CompileJobs.Add(compileJob); // will be saved by job context
|
||||
|
||||
job.PostComplete = ct => compileJobConsumer.LoadCompileJob(compileJob, ct);
|
||||
job.PostComplete = async postCompleteCancellationToken =>
|
||||
{
|
||||
await compileJobConsumer.LoadCompileJob(compileJob, postCompleteCancellationToken).ConfigureAwait(false);
|
||||
await eventConsumer.HandleEvent(EventType.DeploymentComplete, null, postCompleteCancellationToken).ConfigureAwait(false);
|
||||
};
|
||||
|
||||
if (repositorySettings?.AccessToken != null)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Tgstation.Server.Host.Components.Interop
|
||||
/// <summary>
|
||||
/// The DMAPI <see cref="Version"/> being used.
|
||||
/// </summary>
|
||||
public static readonly Version Version = new Version(5, 0, 0);
|
||||
public static readonly Version Version = new Version(5, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="JsonSerializerSettings"/> for use when communicating with the DMAPI.
|
||||
|
||||
@@ -25,6 +25,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <inheritdoc />
|
||||
public sealed override Models.CompileJob ActiveCompileJob => Server?.Dmb.CompileJob;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override string DeploymentTimeWhileRunning => "immediately";
|
||||
|
||||
/// <inheritdoc />
|
||||
public sealed override RebootState? RebootState => Server?.RebootState;
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <inheritdoc />
|
||||
public override RebootState? RebootState => Running ? (AlphaIsActive ? alphaServer?.RebootState : bravoServer?.RebootState) : null;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override string DeploymentTimeWhileRunning => "when DreamDaemon reboots";
|
||||
|
||||
/// <summary>
|
||||
/// Server designation alpha
|
||||
/// </summary>
|
||||
|
||||
@@ -21,6 +21,11 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// </summary>
|
||||
bool AlphaIsActive { get; }
|
||||
|
||||
/// <summary>
|
||||
/// When new <see cref="Models.CompileJob"/>s will be made active.
|
||||
/// </summary>
|
||||
string DeploymentApplicationTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="CompileJob"/> currently running on the server
|
||||
/// </summary>
|
||||
@@ -37,7 +42,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
DreamDaemonLaunchParameters LastLaunchParameters { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Components.Watchdog.RebootState"/> of the active server
|
||||
/// The <see cref="Watchdog.RebootState"/> of the active server
|
||||
/// </summary>
|
||||
RebootState? RebootState { get; }
|
||||
|
||||
|
||||
@@ -32,6 +32,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <inheritdoc />
|
||||
public abstract bool AlphaIsActive { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string DeploymentApplicationTime => Running ? DeploymentTimeWhileRunning : "when DreamDaemon is launched";
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract Models.CompileJob ActiveCompileJob { get; }
|
||||
|
||||
@@ -44,6 +47,11 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <inheritdoc />
|
||||
public abstract RebootState? RebootState { get; }
|
||||
|
||||
/// <summary>
|
||||
/// When deployments happen if the <see cref="IWatchdog"/> is <see cref="Running"/>.
|
||||
/// </summary>
|
||||
protected abstract string DeploymentTimeWhileRunning { get; }
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="TaskCompletionSource{TResult}"/> that completes when <see cref="ActiveLaunchParameters"/> are changed and we are <see cref="Running"/>.
|
||||
/// </summary>
|
||||
|
||||
@@ -19,6 +19,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// </summary>
|
||||
sealed class WindowsWatchdog : BasicWatchdog
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override string DeploymentTimeWhileRunning => "when DreamDaemon reboots";
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IIOManager"/> for the <see cref="WindowsWatchdog"/>.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user