Commit b31c6704 authored by Alexander A. Klimov's avatar Alexander A. Klimov

Merge branch 'bugfix/chocolatey' into 'master'

Add chocolatey pack and upload

See merge request !2
parents 8d4fda8f 08ac791e
Pipeline #10309 failed with stages
in 21 seconds
stages:
- build
- pack-choco
- upload
variables:
......@@ -14,7 +15,7 @@ variables:
tags:
- windows
script:
- Remove-Item *.msi,*.nupkg,*.nuspec,*.zip
- Remove-Item *.msi,*.nupkg,*.nuspec,*.zip,.\icinga2\build\*.nupkg
- powershell.exe .\source.ps1
- powershell.exe .\build.ps1
- powershell.exe .\artifacts.ps1
......@@ -25,9 +26,10 @@ variables:
artifacts:
paths:
- 'Icinga*.msi'
- '*.nupkg'
- '*.nuspec'
- '*.zip'
- '.\icinga2\Build\choco\'
- '.\icinga2\choco\chocolateyUninstall.ps1'
- '.\icinga2\tools\win32\build-choco.ps1'
expire_in: 1 week
Win32:
......@@ -40,6 +42,17 @@ Win64:
variables:
BITS: 64
pack-choco:
stage: pack-choco
tags:
- windows
script:
- powershell.exe .\pack-choco.ps1
artifacts:
paths:
- '*.nupkg'
expire_in: 1 week
upload:
stage: upload
tags:
......@@ -49,3 +62,17 @@ upload:
only:
- master
- tags
dependencies:
- Win32
- Win64
upload-choco:
stage: upload
tags:
- windows
script:
- powershell.exe .\upload-choco.ps1
dependencies:
- pack-choco
only:
- tags
......@@ -45,7 +45,5 @@ if ($env:ICINGA_BUILD_TYPE -eq "snapshot" -and $env:UPSTREAM_GIT_BRANCH -ne "mas
Remove-Item *.msi,*.nupkg,*.nuspec,*.zip
Copy-Item .\icinga2\Build\Icinga*.msi ".\Icinga2-${version}-${arch}.msi"
Copy-Item .\icinga2\Build\choco\*.nuspec ".\Icinga2-${version}.nuspec"
Copy-Item .\icinga2\Build\choco\*.nupkg ".\Icinga2-${version}.nupkg"
7z a -tzip "icinga2-${version}-${arch}-symbols.zip" ".\icinga2\Build\Bin\${env:CMAKE_BUILD_TYPE}\${env:CMAKE_BUILD_TYPE}\*.pdb"
Set-PSDebug -Trace 1
Copy-Item -Path ".\*.msi" -Destination ".\icinga2\Build"
$file = gi .\icinga2\build\choco\icinga2.nuspec
[xml]$xml = gc $file
$xml.package.files.ChildNodes.Item(0).src = "chocolateyInstall.ps1"
$xml.package.files.ChildNodes.Item(1).src = "../../choco/chocolateyUninstall.ps1"
$xml.Save($file.Fullname)
cd .\icinga2
& powershell.exe .\tools\win32\build-choco.ps1
if ($LastExitCode -ne 0) { throw "Error during chocolatey build" }
Move-Item -Path ".\build\icinga2*.nupkg" -Destination ".."
Set-PSDebug -Trace 1
if (-not (Test-Path env:CHOCO_API_KEY)) {
throw "Environment CHOCO_API_KEY is missing!"
}
choco apikey -k "${env:CHOCO_API_KEY}" -source https://push.chocolatey.org/
choco push --source https://push.chocolatey.org/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment