Skip to content

Commit 6ef4003

Browse files
Merge pull request #26 from StefanScherer/jenkins-tag-name
Use Jenkins variable TAG_NAME
2 parents 594e6e4 + 0255a6f commit 6ef4003

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pipeline {
3333
NugetAPIKey = credentials('nuget-api-key')
3434
}
3535
steps {
36-
bat 'docker run --rm -v %cd%:C:/work -w C:/work/src -e NugetAPIKey mcr.microsoft.com/dotnet/framework/sdk:4.8-20190910-windowsservercore-ltsc2019 powershell -File build.ps1 -Target Nuget-push'
36+
bat 'docker run --rm -v %cd%:C:/work -w C:/work/src -e NugetAPIKey -e TAG_NAME mcr.microsoft.com/dotnet/framework/sdk:4.8-20190910-windowsservercore-ltsc2019 powershell -File build.ps1 -Target Nuget-push'
3737
}
3838
}
3939
}

src/build.cake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Task("Nuget-pack")
4141
.IsDependentOn("Nuget-Restore")
4242
.Does(()=>{
4343
var version = "0.1.0";
44-
if(BuildSystem.AppVeyor.Environment.Repository.Tag.IsTag){
45-
version = BuildSystem.AppVeyor.Environment.Repository.Tag.Name;
44+
if(HasEnvironmentVariable("TAG_NAME")){
45+
version = EnvironmentVariable("TAG_NAME");
4646
}
4747
var settings = new DotNetCorePackSettings
4848
{
@@ -58,7 +58,7 @@ Task("Nuget-pack")
5858
Task("Nuget-push")
5959
.IsDependentOn("Nuget-pack")
6060
.Does(()=>{
61-
if(!BuildSystem.AppVeyor.Environment.Repository.Tag.IsTag){
61+
if(!HasEnvironmentVariable("TAG_NAME")){
6262
return;
6363
}
6464
// Get the paths to the packages.

0 commit comments

Comments
 (0)