From c08b37426e65fbd246e4794eb940c870a803f5f5 Mon Sep 17 00:00:00 2001 From: Manuel Sabban Date: Thu, 9 Feb 2023 13:15:36 +0100 Subject: [PATCH] Fix azure pipeline (#2046) (#2047) * use the tag name from the predefined variable for azure pipeline (#2041) * fix typo when assigning build_version in azure pipeline (#2044) * Fix azure pipeline (#2046) --------- Co-authored-by: blotus --- azure-pipelines.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b1adfa2f9..2002c3959 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -56,25 +56,22 @@ stages: --input "**/*.exe" --config (Join-Path -Path $(Agent.TempDirectory) -ChildPath "appsettings.json") ` --user $(CodeSigningUser) --secret '$(CodeSigningPassword)' displayName: "Sign Crowdsec binaries + plugins" - - pwsh: | - $build_version=$Build.SourceBranchName + $build_version=$env:BUILD_SOURCEBRANCHNAME if ($build_version.Contains("-")) { $build_version = $build_version.Substring(0, $build_version.IndexOf("-")) } - .\make_installer.ps1 -version $build_version Write-Host "##vso[task.setvariable variable=BuildVersion;isOutput=true]$build_version" + displayName: GetCrowdsecVersion + name: GetCrowdsecVersion + - pwsh: | + .\make_installer.ps1 -version '$(GetCrowdsecVersion.BuildVersion)' displayName: "Build Crowdsec MSI" name: BuildMSI - pwsh: | -< $build_version=$Build.SourceBranchName - if ($build_version.Contains("-")) - { - $build_version = $build_version.Substring(0, $build_version.IndexOf("-")) - } - .\make_chocolatey.ps1 -version $build_version + .\make_chocolatey.ps1 -version '$(GetCrowdsecVersion.BuildVersion)' displayName: "Build Chocolatey nupkg" - pwsh: | @@ -85,14 +82,14 @@ stages: - task: PublishBuildArtifacts@1 inputs: - PathtoPublish: '$(Build.Repository.LocalPath)\\crowdsec_$(BuildMSI.BuildVersion).msi' + PathtoPublish: '$(Build.Repository.LocalPath)\\crowdsec_$(GetCrowdsecVersion.BuildVersion).msi' ArtifactName: 'crowdsec.msi' publishLocation: 'Container' displayName: "Upload MSI artifact" - task: PublishBuildArtifacts@1 inputs: - PathtoPublish: '$(Build.Repository.LocalPath)\\windows\\Chocolatey\\crowdsec\\crowdsec.$(BuildMSI.BuildVersion).nupkg' + PathtoPublish: '$(Build.Repository.LocalPath)\\windows\\Chocolatey\\crowdsec\\crowdsec.$(GetCrowdsecVersion.BuildVersion).nupkg' ArtifactName: 'crowdsec.nupkg' publishLocation: 'Container' displayName: "Upload nupkg artifact"