Tweaks to versioning scheme

Nuke staging
This commit is contained in:
Westin Miller
2017-12-02 12:14:48 -08:00
parent 039c5d9244
commit 72b6d0e7bb
7 changed files with 21 additions and 28 deletions

12
Jenkinsfile vendored
View File

@@ -71,16 +71,4 @@ node {
]]
])
}
if (env.BRANCH_NAME == "master") {
gitVersion = bat(returnStdout: true, script: "@git describe --tags").trim()
gitSimpleVersion = bat(returnStdout: true, script: "@git describe --tags --abbrev=0").trim()
if (gitVersion == gitSimpleVersion) {
stage('${buildMode}') {
withCredentials([usernamePassword(credentialsId: 'torch-github', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
powershell "& ./Jenkins/${buildMode}.ps1 \"https://api.github.com/repos/TorchAPI/Torch/\" \"$gitSimpleVersion\" \"$USERNAME:$PASSWORD\" @(\"bin/torch-server.zip\", \"bin/torch-client.zip\")"
}
}
}
}
}

View File

@@ -103,7 +103,6 @@ namespace Torch.Server
private ServerState _state;
private TimeSpan _elapsedPlayTime;
private float _simRatio;
private readonly AutoResetEvent _stopHandle = new AutoResetEvent(false);
private Timer _watchdog;
private Stopwatch _uptime;
@@ -169,8 +168,6 @@ namespace Torch.Server
Log.Info("Stopping server.");
base.Stop();
Log.Info("Server stopped.");
LogManager.Flush();
_stopHandle.Set();
State = ServerState.Stopped;
IsRunning = false;

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using Torch.Utils;
@@ -42,8 +43,15 @@ namespace Torch.Tests
public ReflectionTestManager Init(Assembly asm)
{
foreach (Type type in asm.GetTypes())
Init(type);
try
{
foreach (Type type in asm.GetTypes())
Init(type);
}
catch (ReflectionTypeLoadException e)
{
throw e.LoaderExceptions[0];
}
return this;
}

View File

@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Torch.Utils;

View File

@@ -394,6 +394,7 @@ namespace Torch
/// <inheritdoc />
public virtual void Stop()
{
LogManager.Flush();
_game.SignalStop();
if (!_game.WaitFor(VRageGame.GameState.Stopped, TimeSpan.FromSeconds(15)))
Log.Warn("Failed to wait for the game to be stopped");

View File

@@ -1,20 +1,17 @@
$buildSalt = $Env:BUILD_NUMBER
$gitVersion = git describe --tags
$gitSimpleVersion = git describe --tags --abbrev=0
if ($gitSimpleVersion.Equals($gitVersion)) {
$buildSalt = 0
} else {
$gitLatestCommit = git rev-parse --short HEAD
$buildSalt = [System.Numerics.BigInteger]::Abs([System.Numerics.BigInteger]::Parse($gitLatestCommit, [System.Globalization.NumberStyles]::HexNumber) % 16383) + 1
}
$dotNetVersion = echo $gitSimpleVersion | Select-String -Pattern "([0-9]+)\.([0-9]+)\.([0-9]+)" | % {$_.Matches} | %{$_.Groups[1].Value+"."+$_.Groups[2].Value+"."+$_.Groups[3].Value+".$buildSalt"}
$simpleVersionStandard = echo $gitSimpleVersion | Select-String -Pattern "([0-9]+)\.([0-9]+)\.([0-9]+)" | % {$_.Matches} | %{$_.Groups[1].Value+"."+$_.Groups[2].Value+"."+$_.Groups[3].Value}
$dotNetVersion = "$simpleVersionStandard.$buildSalt"
$infoVersion = "$gitVersion" -replace "([0-9]+)\.([0-9]+)\.([0-9]+)","$dotNetVersion"
$fileContent = @"
using System.Reflection;
[assembly: AssemblyVersion("$dotNetVersion")]
[assembly: AssemblyInformationalVersion("$gitVersion")]
[assembly: AssemblyInformationalVersion("$infoVersion")]
"@
echo $fileContent | Set-Content "$PSScriptRoot/AssemblyVersion.cs"
echo "$gitVersion / $dotNetVersion"
echo "$infoVersion"