Tweaks to versioning scheme
Nuke staging
This commit is contained in:
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
@@ -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\")"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@@ -103,7 +103,6 @@ namespace Torch.Server
|
|||||||
private ServerState _state;
|
private ServerState _state;
|
||||||
private TimeSpan _elapsedPlayTime;
|
private TimeSpan _elapsedPlayTime;
|
||||||
private float _simRatio;
|
private float _simRatio;
|
||||||
private readonly AutoResetEvent _stopHandle = new AutoResetEvent(false);
|
|
||||||
private Timer _watchdog;
|
private Timer _watchdog;
|
||||||
private Stopwatch _uptime;
|
private Stopwatch _uptime;
|
||||||
|
|
||||||
@@ -169,8 +168,6 @@ namespace Torch.Server
|
|||||||
Log.Info("Stopping server.");
|
Log.Info("Stopping server.");
|
||||||
base.Stop();
|
base.Stop();
|
||||||
Log.Info("Server stopped.");
|
Log.Info("Server stopped.");
|
||||||
LogManager.Flush();
|
|
||||||
_stopHandle.Set();
|
|
||||||
|
|
||||||
State = ServerState.Stopped;
|
State = ServerState.Stopped;
|
||||||
IsRunning = false;
|
IsRunning = false;
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Torch.Utils;
|
using Torch.Utils;
|
||||||
|
|
||||||
@@ -41,9 +42,16 @@ namespace Torch.Tests
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ReflectionTestManager Init(Assembly asm)
|
public ReflectionTestManager Init(Assembly asm)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
foreach (Type type in asm.GetTypes())
|
foreach (Type type in asm.GetTypes())
|
||||||
Init(type);
|
Init(type);
|
||||||
|
}
|
||||||
|
catch (ReflectionTypeLoadException e)
|
||||||
|
{
|
||||||
|
throw e.LoaderExceptions[0];
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Torch.Utils;
|
using Torch.Utils;
|
||||||
|
@@ -394,6 +394,7 @@ namespace Torch
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual void Stop()
|
public virtual void Stop()
|
||||||
{
|
{
|
||||||
|
LogManager.Flush();
|
||||||
_game.SignalStop();
|
_game.SignalStop();
|
||||||
if (!_game.WaitFor(VRageGame.GameState.Stopped, TimeSpan.FromSeconds(15)))
|
if (!_game.WaitFor(VRageGame.GameState.Stopped, TimeSpan.FromSeconds(15)))
|
||||||
Log.Warn("Failed to wait for the game to be stopped");
|
Log.Warn("Failed to wait for the game to be stopped");
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
|
$buildSalt = $Env:BUILD_NUMBER
|
||||||
$gitVersion = git describe --tags
|
$gitVersion = git describe --tags
|
||||||
$gitSimpleVersion = git describe --tags --abbrev=0
|
$gitSimpleVersion = git describe --tags --abbrev=0
|
||||||
if ($gitSimpleVersion.Equals($gitVersion)) {
|
$simpleVersionStandard = echo $gitSimpleVersion | Select-String -Pattern "([0-9]+)\.([0-9]+)\.([0-9]+)" | % {$_.Matches} | %{$_.Groups[1].Value+"."+$_.Groups[2].Value+"."+$_.Groups[3].Value}
|
||||||
$buildSalt = 0
|
$dotNetVersion = "$simpleVersionStandard.$buildSalt"
|
||||||
} else {
|
$infoVersion = "$gitVersion" -replace "([0-9]+)\.([0-9]+)\.([0-9]+)","$dotNetVersion"
|
||||||
$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"}
|
|
||||||
|
|
||||||
$fileContent = @"
|
$fileContent = @"
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("$dotNetVersion")]
|
[assembly: AssemblyVersion("$dotNetVersion")]
|
||||||
[assembly: AssemblyInformationalVersion("$gitVersion")]
|
[assembly: AssemblyInformationalVersion("$infoVersion")]
|
||||||
"@
|
"@
|
||||||
|
|
||||||
echo $fileContent | Set-Content "$PSScriptRoot/AssemblyVersion.cs"
|
echo $fileContent | Set-Content "$PSScriptRoot/AssemblyVersion.cs"
|
||||||
|
|
||||||
echo "$gitVersion / $dotNetVersion"
|
echo "$infoVersion"
|
Reference in New Issue
Block a user