Include git sha in binary
This commit is contained in:
parent
7238e7177d
commit
59ee6b289a
6 changed files with 15 additions and 6 deletions
|
@ -22,7 +22,7 @@ build:
|
||||||
script:
|
script:
|
||||||
- dotnet restore
|
- dotnet restore
|
||||||
- dotnet test Tests
|
- dotnet test Tests
|
||||||
- dotnet publish --configuration Release -o Binaries ./
|
- dotnet publish --version-suffix ${CI_COMMIT_SHA:0:8} --configuration Release -o Binaries ./
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace Geekbot.net.Commands.Utils
|
||||||
|
|
||||||
eb.WithAuthor(new EmbedAuthorBuilder()
|
eb.WithAuthor(new EmbedAuthorBuilder()
|
||||||
.WithIconUrl(_client.CurrentUser.GetAvatarUrl())
|
.WithIconUrl(_client.CurrentUser.GetAvatarUrl())
|
||||||
.WithName($"{Constants.Name} V{Constants.BotVersion}"));
|
.WithName($"{Constants.Name} V{Constants.BotVersion()}"));
|
||||||
var botOwner = await Context.Guild.GetUserAsync(ulong.Parse(_redis.StringGet("botOwner")));
|
var botOwner = await Context.Guild.GetUserAsync(ulong.Parse(_redis.StringGet("botOwner")));
|
||||||
var uptime = DateTime.Now.Subtract(Process.GetCurrentProcess().StartTime);
|
var uptime = DateTime.Now.Subtract(Process.GetCurrentProcess().StartTime);
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<ApplicationIcon>derp.ico</ApplicationIcon>
|
<ApplicationIcon>derp.ico</ApplicationIcon>
|
||||||
<Version>3.7.0</Version>
|
<Version>3.7.0</Version>
|
||||||
|
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
|
||||||
|
<Version Condition=" '$(VersionSuffix)' != '' ">$(Version)-$(VersionSuffix)</Version>
|
||||||
<Company>Pizza and Coffee Studios</Company>
|
<Company>Pizza and Coffee Studios</Company>
|
||||||
<Authors>Pizza and Coffee Studios</Authors>
|
<Authors>Pizza and Coffee Studios</Authors>
|
||||||
<Description>A Discord bot</Description>
|
<Description>A Discord bot</Description>
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
namespace Geekbot.net.Lib
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace Geekbot.net.Lib
|
||||||
{
|
{
|
||||||
public class Constants
|
public class Constants
|
||||||
{
|
{
|
||||||
public const string Name = "Geekbot";
|
public const string Name = "Geekbot";
|
||||||
public const double BotVersion = 3.7;
|
|
||||||
|
public static string BotVersion()
|
||||||
|
{
|
||||||
|
return typeof(Program).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
|
||||||
|
}
|
||||||
|
|
||||||
public const double ApiVersion = 1;
|
public const double ApiVersion = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -25,7 +25,7 @@ namespace Geekbot.net.Lib.ErrorHandling
|
||||||
var sentryDsn = Environment.GetEnvironmentVariable("SENTRY");
|
var sentryDsn = Environment.GetEnvironmentVariable("SENTRY");
|
||||||
if (!string.IsNullOrEmpty(sentryDsn))
|
if (!string.IsNullOrEmpty(sentryDsn))
|
||||||
{
|
{
|
||||||
_raven = new RavenClient(sentryDsn);
|
_raven = new RavenClient(sentryDsn) { Release = Constants.BotVersion() };
|
||||||
_logger.Information(LogSource.Geekbot, $"Command Errors will be logged to Sentry: {sentryDsn}");
|
_logger.Information(LogSource.Geekbot, $"Command Errors will be logged to Sentry: {sentryDsn}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace Geekbot.net.WebApi.Status
|
||||||
{
|
{
|
||||||
var responseBody = new ApiStatusDto
|
var responseBody = new ApiStatusDto
|
||||||
{
|
{
|
||||||
GeekbotVersion = Constants.BotVersion.ToString(),
|
GeekbotVersion = Constants.BotVersion(),
|
||||||
ApiVersion = Constants.ApiVersion.ToString(),
|
ApiVersion = Constants.ApiVersion.ToString(),
|
||||||
Status = "Online"
|
Status = "Online"
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue