diff --git a/appveyor.yml b/appveyor.yml
index ace9d4cd11..f157c98a3d 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -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
diff --git a/build/Version.props b/build/Version.props
index b9cd0eadbd..5166e7ce3c 100644
--- a/build/Version.props
+++ b/build/Version.props
@@ -5,7 +5,7 @@
4.1.0
6.1.0
6.0.0
- 5.0.0
+ 5.1.0
0.4.0
1.1.0
diff --git a/src/DMAPI/tgs.dm b/src/DMAPI/tgs.dm
index 2596533783..4095138f2b 100644
--- a/src/DMAPI/tgs.dm
+++ b/src/DMAPI/tgs.dm
@@ -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
diff --git a/src/DMAPI/tgs/v5/api.dm b/src/DMAPI/tgs/v5/api.dm
index 5b6d22fffc..b8c4149905 100644
--- a/src/DMAPI/tgs/v5/api.dm
+++ b/src/DMAPI/tgs/v5/api.dm
@@ -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)
diff --git a/src/Tgstation.Server.Host/Components/Deployment/DreamMaker.cs b/src/Tgstation.Server.Host/Components/Deployment/DreamMaker.cs
index 0a7a26153a..679a42b394 100644
--- a/src/Tgstation.Server.Host/Components/Deployment/DreamMaker.cs
+++ b/src/Tgstation.Server.Host/Components/Deployment/DreamMaker.cs
@@ -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!");
}
diff --git a/src/Tgstation.Server.Host/Components/EventType.cs b/src/Tgstation.Server.Host/Components/EventType.cs
index f711742dbe..e501403ebf 100644
--- a/src/Tgstation.Server.Host/Components/EventType.cs
+++ b/src/Tgstation.Server.Host/Components/EventType.cs
@@ -8,71 +8,76 @@
///
/// Parameters: Reference name, commit sha
///
- RepoResetOrigin = 0,
+ RepoResetOrigin,
///
/// Parameters: Checkout target
///
- RepoCheckout = 1,
+ RepoCheckout,
///
/// No parameters
///
- RepoFetch = 2,
+ RepoFetch,
///
/// Parameters: Pull request number, pull request sha, merger message
///
- RepoMergePullRequest = 3,
+ RepoMergePullRequest,
///
/// Parameters: Absolute path to repository root
///
- RepoPreSynchronize = 4,
+ RepoPreSynchronize,
///
/// Parameters: Version being installed
///
- ByondInstallStart = 5,
+ ByondInstallStart,
///
/// Parameters: Error string
///
- ByondInstallFail = 6,
+ ByondInstallFail,
///
/// Parameters: Old active version, new active version
///
- ByondActiveVersionChange = 7,
+ ByondActiveVersionChange,
///
/// Parameters: Game directory path, origin commit sha
///
- CompileStart = 8,
+ CompileStart,
///
/// No parameters
///
- CompileCancelled = 9,
+ CompileCancelled,
///
/// Parameters: Game directory path, "1" if compile succeeded and api validation failed, "0" otherwise
///
- CompileFailure = 10,
+ CompileFailure,
///
/// Parameters: Game directory path
///
- CompileComplete = 11,
+ CompileComplete,
///
/// No parameters
///
- InstanceAutoUpdateStart = 12,
+ InstanceAutoUpdateStart,
///
/// Parameters: Base sha, target sha, base reference, target reference
///
- RepoMergeConflict = 13,
+ RepoMergeConflict,
+
+ ///
+ /// No parameters
+ ///
+ DeploymentComplete
}
}
diff --git a/src/Tgstation.Server.Host/Components/Instance.cs b/src/Tgstation.Server.Host/Components/Instance.cs
index 34d582a381..687eb2c246 100644
--- a/src/Tgstation.Server.Host/Components/Instance.cs
+++ b/src/Tgstation.Server.Host/Components/Instance.cs
@@ -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)
{
diff --git a/src/Tgstation.Server.Host/Components/Interop/DMApiConstants.cs b/src/Tgstation.Server.Host/Components/Interop/DMApiConstants.cs
index b0b95efbae..f14967cf94 100644
--- a/src/Tgstation.Server.Host/Components/Interop/DMApiConstants.cs
+++ b/src/Tgstation.Server.Host/Components/Interop/DMApiConstants.cs
@@ -33,7 +33,7 @@ namespace Tgstation.Server.Host.Components.Interop
///
/// The DMAPI being used.
///
- public static readonly Version Version = new Version(5, 0, 0);
+ public static readonly Version Version = new Version(5, 1, 0);
///
/// for use when communicating with the DMAPI.
diff --git a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs
index 1b8e579d40..8eacde8b8c 100644
--- a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs
+++ b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs
@@ -25,6 +25,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
///
public sealed override Models.CompileJob ActiveCompileJob => Server?.Dmb.CompileJob;
+ ///
+ protected override string DeploymentTimeWhileRunning => "immediately";
+
///
public sealed override RebootState? RebootState => Server?.RebootState;
diff --git a/src/Tgstation.Server.Host/Components/Watchdog/ExperimentalWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/ExperimentalWatchdog.cs
index 333582ed73..dc3e4eb1f5 100644
--- a/src/Tgstation.Server.Host/Components/Watchdog/ExperimentalWatchdog.cs
+++ b/src/Tgstation.Server.Host/Components/Watchdog/ExperimentalWatchdog.cs
@@ -34,6 +34,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
///
public override RebootState? RebootState => Running ? (AlphaIsActive ? alphaServer?.RebootState : bravoServer?.RebootState) : null;
+ ///
+ protected override string DeploymentTimeWhileRunning => "when DreamDaemon reboots";
+
///
/// Server designation alpha
///
diff --git a/src/Tgstation.Server.Host/Components/Watchdog/IWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/IWatchdog.cs
index 926d5239ba..8fac965b1f 100644
--- a/src/Tgstation.Server.Host/Components/Watchdog/IWatchdog.cs
+++ b/src/Tgstation.Server.Host/Components/Watchdog/IWatchdog.cs
@@ -21,6 +21,11 @@ namespace Tgstation.Server.Host.Components.Watchdog
///
bool AlphaIsActive { get; }
+ ///
+ /// When new s will be made active.
+ ///
+ string DeploymentApplicationTime { get; }
+
///
/// The currently running on the server
///
@@ -37,7 +42,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
DreamDaemonLaunchParameters LastLaunchParameters { get; }
///
- /// The of the active server
+ /// The of the active server
///
RebootState? RebootState { get; }
diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs
index b3877611ec..3262a914a6 100644
--- a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs
+++ b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs
@@ -32,6 +32,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
///
public abstract bool AlphaIsActive { get; }
+ ///
+ public string DeploymentApplicationTime => Running ? DeploymentTimeWhileRunning : "when DreamDaemon is launched";
+
///
public abstract Models.CompileJob ActiveCompileJob { get; }
@@ -44,6 +47,11 @@ namespace Tgstation.Server.Host.Components.Watchdog
///
public abstract RebootState? RebootState { get; }
+ ///
+ /// When deployments happen if the is .
+ ///
+ protected abstract string DeploymentTimeWhileRunning { get; }
+
///
/// that completes when are changed and we are .
///
diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs
index 74b6b25dac..a1d56b5e59 100644
--- a/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs
+++ b/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs
@@ -19,6 +19,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
///
sealed class WindowsWatchdog : BasicWatchdog
{
+ ///
+ protected override string DeploymentTimeWhileRunning => "when DreamDaemon reboots";
+
///
/// The for the .
///