Compiler model

This commit is contained in:
Cyberboss
2018-04-03 13:39:32 -04:00
parent 30c8e65c72
commit 0fcd5df18e
3 changed files with 79 additions and 1 deletions
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Tgstation.Server.Api.Models
{
/// <summary>
/// Represents the state of the DreamMaker compiler
/// </summary>
public sealed class Compiler
{
/// <summary>
/// When the compilation started
/// </summary>
public DateTimeOffset StartedAt { get; set; }
/// <summary>
/// When the compilation finished
/// </summary>
public DateTimeOffset FinishedAt { get; set; }
/// <summary>
/// The <see cref="CompilerStatus"/> of the compiler
/// </summary>
public CompilerStatus Status { get; set; }
/// <summary>
/// If the compiler targeted the primary directory
/// </summary>
public bool? TargetedPrimaryDirectory { get; set; }
/// <summary>
/// Textual output of DM
/// </summary>
public string Output { get; set; }
/// <summary>
/// Exit code of DM
/// </summary>
public int? ExitCode { get; set; }
/// <summary>
/// Git revision the compiler ran on
/// </summary>
public string Revision { get; set; }
/// <summary>
/// Git revision of the origin branch the compiler ran on
/// </summary>
public string OriginRevision { get; set; }
}
}
@@ -0,0 +1,27 @@
namespace Tgstation.Server.Api.Models
{
/// <summary>
/// Status of the <see cref="Compiler"/> for an <see cref="Instance"/>
/// </summary>
#pragma warning disable CA1717 // Only FlagsAttribute enums should have plural names
public enum CompilerStatus
#pragma warning restore CA1717 // Only FlagsAttribute enums should have plural names
{
/// <summary>
/// The <see cref="Compiler"/> is idle
/// </summary>
Idle,
/// <summary>
/// The directiory is being targeted
/// </summary>
Targeting,
/// <summary>
/// The <see cref="Repository"/> is being copied
/// </summary>
Copying,
/// <summary>
/// DreamMaker is running
/// </summary>
Compiling
}
}
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
namespace Tgstation.Server.Api.Models
{
@@ -66,5 +67,10 @@ namespace Tgstation.Server.Api.Models
/// The port the running <see cref="DreamDaemon"/> instance is set to. Not modifiable
/// </summary>
public bool CurrentPort { get; set; }
/// <summary>
/// When the live revision was compiled. Not modifiable
/// </summary>
public DateTimeOffset CompiledOn { get; set; }
}
}