Skip to content

Commit

Permalink
Merge pull request docker#26 from StefanScherer/jenkins-tag-name
Browse files Browse the repository at this point in the history
Use Jenkins variable TAG_NAME
  • Loading branch information
StefanScherer committed Oct 23, 2019
2 parents 594e6e4 + 0255a6f commit 6ef4003
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Expand Up @@ -33,7 +33,7 @@ pipeline {
NugetAPIKey = credentials('nuget-api-key')
}
steps {
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'
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'
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/build.cake
Expand Up @@ -41,8 +41,8 @@ Task("Nuget-pack")
.IsDependentOn("Nuget-Restore")
.Does(()=>{
var version = "0.1.0";
if(BuildSystem.AppVeyor.Environment.Repository.Tag.IsTag){
version = BuildSystem.AppVeyor.Environment.Repository.Tag.Name;
if(HasEnvironmentVariable("TAG_NAME")){
version = EnvironmentVariable("TAG_NAME");
}
var settings = new DotNetCorePackSettings
{
Expand All @@ -58,7 +58,7 @@ Task("Nuget-pack")
Task("Nuget-push")
.IsDependentOn("Nuget-pack")
.Does(()=>{
if(!BuildSystem.AppVeyor.Environment.Repository.Tag.IsTag){
if(!HasEnvironmentVariable("TAG_NAME")){
return;
}
// Get the paths to the packages.
Expand Down

0 comments on commit 6ef4003

Please sign in to comment.