Skip to content

Commit 820be27

Browse files
committed
Nuke staging
1 parent 11f80a5 commit 820be27

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

Jenkinsfile

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ node {
5959

6060
if (env.BRANCH_NAME == "master") {
6161
buildMode = "Release"
62-
result = test_with_torch("master")
6362
} else {
6463
buildMode = "Debug"
65-
result = test_with_torch("staging")
6664
}
65+
result = test_with_torch("master")
6766
if (result) {
6867
currentBuild.result = "SUCCESS"
6968
stage('Archive') {
@@ -83,18 +82,6 @@ node {
8382
powershell "Add-Type -Assembly System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::CreateFromDirectory(\"\$PWD\\${packageDir}\", \"\$PWD\\${zipFile}\")"
8483
archiveArtifacts artifacts: zipFile, caseSensitive: false, onlyIfSuccessful: true
8584
}
86-
87-
if (env.BRANCH_NAME == "master") {
88-
gitVersion = bat(returnStdout: true, script: "@git describe --tags").trim()
89-
gitSimpleVersion = bat(returnStdout: true, script: "@git describe --tags --abbrev=0").trim()
90-
if (gitVersion == gitSimpleVersion) {
91-
stage('Release') {
92-
withCredentials([usernamePassword(credentialsId: 'torch-github', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
93-
powershell "& ./Jenkins/release.ps1 \"https://api.github.com/repos/TorchAPI/Essentials/\" \"$gitSimpleVersion\" \"$USERNAME:$PASSWORD\" @(\"bin/essentials.zip\")"
94-
}
95-
}
96-
}
97-
}
9885
}
9986
else
10087
currentBuild.result = "FAIL"

Versioning/version.ps1

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1+
$buildSalt = $Env:BUILD_NUMBER
12
$gitVersion = git describe --tags
23
$gitSimpleVersion = git describe --tags --abbrev=0
3-
if ($gitSimpleVersion.Equals($gitVersion)) {
4-
$buildSalt = 0
5-
} else {
6-
$gitLatestCommit = git rev-parse --short HEAD
7-
$buildSalt = [System.Numerics.BigInteger]::Abs([System.Numerics.BigInteger]::Parse($gitLatestCommit, [System.Globalization.NumberStyles]::HexNumber) % 16383) + 1
8-
}
9-
$dotNetVersion = echo $gitSimpleVersion | Select-String -Pattern "([0-9]+)\.([0-9]+)\.([0-9]+)" | % {$_.Matches} | %{$_.Groups[1].Value+"."+$_.Groups[2].Value+"."+$_.Groups[3].Value+".$buildSalt"}
4+
$simpleVersionStandard = echo $gitSimpleVersion | Select-String -Pattern "([0-9]+)\.([0-9]+)\.([0-9]+)" | % {$_.Matches} | %{$_.Groups[1].Value+"."+$_.Groups[2].Value+"."+$_.Groups[3].Value}
5+
$dotNetVersion = "$simpleVersionStandard.$buildSalt"
6+
$infoVersion = "$gitVersion" -replace "([0-9]+)\.([0-9]+)\.([0-9]+)","$dotNetVersion"
107

118
$fileContent = @"
129
using System.Reflection;
1310
1411
[assembly: AssemblyVersion("$dotNetVersion")]
15-
[assembly: AssemblyInformationalVersion("$gitVersion")]
12+
[assembly: AssemblyInformationalVersion("$infoVersion")]
1613
"@
1714

1815
echo $fileContent | Set-Content "$PSScriptRoot/AssemblyVersion.cs"
1916

20-
echo "$gitVersion / $dotNetVersion"
17+
echo "$infoVersion"

0 commit comments

Comments
 (0)