tickets.pickle
## Build artifacts
-build/
-build-debug/
-build-release/
-build32/
-build64/
+build*/
debug/
release/
cmake-build-debug
version: 2.9.0.dev.{build}
os: Visual Studio 2017
+platform: x64
environment:
CMAKE_GENERATOR: "Visual Studio 15 2017 Win64"
+ VSCMD_VER: 15.0
BOOST_ROOT: 'C:\Libraries\boost_1_65_1'
BOOST_LIBRARYDIR: 'C:\Libraries\boost_1_65_1\lib64-msvc-14.1'
BISON_BINARY: 'C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_bison.exe'
cache:
- build -> appveyor.yml
-- vendor -> tools\win32\download-openssl.ps1
- C:\ProgramData\chocolatey\lib\winflexbison3
install:
-- ps: |
- if (-not (Test-Path "vendor\OpenSSL")) {
- .\tools\win32\download-openssl.ps1
- if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
- }
- ps: |
if (-not (Test-Path "C:\ProgramData\chocolatey\lib\winflexbison3")) {
- choco install winflexbison3
- if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
+ & choco install winflexbison3
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
}
+# why that env handling, see
+# https://help.appveyor.com/discussions/questions/18777-how-to-use-vcvars64bat-from-powershell#comment_44999171
before_build:
- ps: |
- .\tools\win32\configure.ps1
- if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
+ $bits = $env:PLATFORM -replace "^x", ""
+ cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars${bits}.bat`" && set > `"${env:TEMP}\vcvars.txt`""
+ Get-Content "$env:TEMP\vcvars.txt" | Foreach-Object {
+ if ($_ -match "^(VSCMD.*?)=(.*)$") {
+ Set-Content ("env:" + $matches[1]) $matches[2]
+ }
+ }
+
+ if (-not (Test-Path ".\build\vendor\OpenSSL")) {
+ & .\tools\win32\download-openssl.ps1
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
+ }
+
+ & .\tools\win32\configure.ps1
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
+
del build\Icinga*.msi
build_script:
- ps: |
- .\tools\win32\build.ps1
- if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
+ & .\tools\win32\build.ps1
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
test_script:
- ps: |
- .\tools\win32\test.ps1
- if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
+ & .\tools\win32\test.ps1
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
# Disable until we really need them
# https://github.com/Icinga/icinga2/issues/6106
-[string]$pwd = Get-Location
+if (-not (Test-Path env:ICINGA2_BUILDPATH)) {
+ $env:ICINGA2_BUILDPATH = '.\build'
+}
-if (-not (Test-Path build)) {
- Write-Host "Path '$pwd\build' does not exist!"
+if (-not (Test-Path $env:ICINGA2_BUILDPATH)) {
+ Write-Host "Path '$env:ICINGA2_BUILDPATH' does not exist!"
exit 1
}
$env:PATH = $env:CMAKE_PATH + ';' + $env:PATH
}
-cmake.exe --build build --target PACKAGE --config RelWithDebInfo
-if ($lastexitcode -ne 0) { exit $lastexitcode }
\ No newline at end of file
+cmake.exe --build "$env:ICINGA2_BUILDPATH" --target PACKAGE --config RelWithDebInfo
+if ($lastexitcode -ne 0) { exit $lastexitcode }
-if (-not (Test-Path build)) {
- mkdir build
+if (-not (Test-Path env:ICINGA2_BUILDPATH)) {
+ $env:ICINGA2_BUILDPATH = '.\build'
}
-if (-not (Test-Path install)) {
- mkdir install
+
+if (-not (Test-Path "$env:ICINGA2_BUILDPATH")) {
+ mkdir "$env:ICINGA2_BUILDPATH" | out-null
+}
+if (-not (Test-Path "$env:ICINGA2_BUILDPATH\install")) {
+ mkdir "$env:ICINGA2_BUILDPATH\install" | out-null
}
if (-not (Test-Path env:CMAKE_PATH)) {
$env:CMAKE_PATH = 'C:\Program Files\CMake\bin'
$env:PATH = $env:CMAKE_PATH + ';' + $env:PATH
}
-[string]$pwd = Get-Location
-
if (-not (Test-Path env:CMAKE_GENERATOR)) {
$env:CMAKE_GENERATOR = 'Visual Studio 15 2017 Win64'
}
if (-not (Test-Path env:OPENSSL_ROOT_DIR)) {
- $env:OPENSSL_ROOT_DIR = $pwd + '\vendor\OpenSSL'
+ if (Test-Path env:VSCMD_ARG_TGT_ARCH) {
+ $OpenSSL_arch = $env:VSCMD_ARG_TGT_ARCH
+ } else {
+ throw "Missing env variable VSCMD_ARG_TGT_ARCH"
+ }
+
+ if (Test-Path env:VSCMD_VER) {
+ $VSmajor = $env:VSCMD_VER -replace "\..*$", ""
+ $OpenSSL_vcbuild = "vc${VSmajor}0"
+ } else {
+ throw "Missing env variable VSCMD_VER"
+ }
+
+ $env:OPENSSL_ROOT_DIR = "$env:ICINGA2_BUILDPATH\vendor\OpenSSL-$OpenSSL_arch-$OpenSSL_vcbuild"
}
if (-not (Test-Path env:BOOST_ROOT)) {
$env:BOOST_ROOT = 'c:\local\boost_1_65_1'
$env:BISON_BINARY = 'C:\ProgramData\chocolatey\bin\win_bison.exe'
}
-cd build
+$sourcePath = Get-Location
-& cmake.exe .. `
+cd "$env:ICINGA2_BUILDPATH"
+
+#-DCMAKE_INSTALL_PREFIX="C:\Program Files\Icinga2" `
+
+& cmake.exe "$sourcePath" `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-G $env:CMAKE_GENERATOR -DCPACK_GENERATOR=WIX `
- -DCMAKE_INSTALL_PREFIX="..\install" `
-DICINGA2_WITH_MYSQL=OFF -DICINGA2_WITH_PGSQL=OFF `
-DOPENSSL_ROOT_DIR="$env:OPENSSL_ROOT_DIR" `
-DBOOST_ROOT="$env:BOOST_ROOT" `
-DFLEX_EXECUTABLE="$env:FLEX_BINARY" `
-DBISON_EXECUTABLE="$env:BISON_BINARY"
+cd "$sourcePath"
+
if ($lastexitcode -ne 0) {
- cd ..
exit $lastexitcode
}
-
-cd ..
-[string]$pwd = Get-Location
+$ErrorActionPreference = "Stop"
+
$OpenSSL_version = '1.1.0g-1'
-$OpenSSL_arch = 'x64'
-$OpenSSL_vcbuild = 'vc150'
+
+if (Test-Path env:VSCMD_ARG_TGT_ARCH) {
+ $OpenSSL_arch = $env:VSCMD_ARG_TGT_ARCH
+} else {
+ throw "Missing env variable VSCMD_ARG_TGT_ARCH"
+}
+if (Test-Path env:VSCMD_VER) {
+ $VSmajor = $env:VSCMD_VER -replace "\..*$", ""
+ $OpenSSL_vcbuild = "vc${VSmajor}0"
+} else {
+ throw "Missing env variable VSCMD_VER"
+}
+
$OpenSSL_fileversion = $OpenSSL_version.Replace('.', '_').Split('-')[0]
$OpenSSL_file = [string]::Format(
'openssl-{0}-binary-icinga-{1}-{2}.zip',
$OpenSSL_file
)
-$OpenSSL_zip_location = $pwd + '\vendor\' + $OpenSSL_file
-$vendor_path = $pwd + '\vendor'
-$OpenSSL_vendor_path = $vendor_path + '\OpenSSL'
+if (-not (Test-Path env:ICINGA2_BUILDPATH)) {
+ $env:ICINGA2_BUILDPATH = '.\build'
+}
+
+$vendor_path = $env:ICINGA2_BUILDPATH + '\vendor'
+$OpenSSL_zip_location = $env:ICINGA2_BUILDPATH + '\vendor\' + $OpenSSL_file
+$OpenSSL_vendor_path = "$vendor_path\OpenSSL-$OpenSSL_arch-$OpenSSL_vcbuild"
+# Tune Powershell TLS protocols
+$AllProtocols = [System.Net.SecurityProtocolType]'Tls11,Tls12'
+[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols
+
+if (-not (Test-Path $env:ICINGA2_BUILDPATH)) {
+ mkdir $env:ICINGA2_BUILDPATH | out-null
+}
if (-not (Test-Path $vendor_path)) {
- mkdir $vendor_path
+ mkdir $vendor_path | out-null
}
if (Test-Path $OpenSSL_zip_location) {
$progressPreference = 'silentlyContinue'
Invoke-WebRequest -Uri $OpenSSL_url -OutFile $OpenSSL_zip_location
- if ($lastexitcode -ne 0){ exit $lastexitcode }
$progressPreference = 'Continue'
-
+
if (Test-Path $OpenSSL_vendor_path) {
Remove-Item -Recurse $OpenSSL_vendor_path
}
}
if (-not (Test-Path $OpenSSL_vendor_path)) {
- mkdir $OpenSSL_vendor_path
+ mkdir $OpenSSL_vendor_path | out-null
Write-Output "Extracting ZIP to $OpenSSL_vendor_path"
Add-Type -AssemblyName System.IO.Compression.FileSystem
- [System.IO.Compression.ZipFile]::ExtractToDirectory($OpenSSL_zip_location, $OpenSSL_vendor_path)
- if ($lastexitcode -ne 0){ exit $lastexitcode }
+ $pwd = Get-Location
+ [System.IO.Compression.ZipFile]::ExtractToDirectory(
+ (Join-Path -path $pwd -childpath $OpenSSL_zip_location),
+ (Join-Path -path $pwd -childpath $OpenSSL_vendor_path)
+ )
+ if ($lastexitcode -ne 0){ exit $lastexitcode }
} else {
Write-Output "OpenSSL is already available at $OpenSSL_vendor_path"
}
+if (-not (Test-Path env:ICINGA2_BUILDPATH)) {
+ $env:ICINGA2_BUILDPATH = 'build'
+}
+
[string]$pwd = Get-Location
-if (-not (Test-Path build)) {
- Write-Host "Path '$pwd\build' does not exist!"
+if (-not (Test-Path $env:ICINGA2_BUILDPATH)) {
+ Write-Host "Path '$pwd\$env:ICINGA2_BUILDPATH' does not exist!"
exit 1
}
$env:PATH = $env:CMAKE_PATH + ';' + $env:PATH
}
-cd build
+cd "$env:ICINGA2_BUILDPATH"
-ctest.exe -C RelWithDebInfo -T test -O build/Test.xml --output-on-failure
+ctest.exe -C RelWithDebInfo -T test -O $env:ICINGA2_BUILDPATH/Test.xml --output-on-failure
if ($lastexitcode -ne 0) {
cd ..
exit $lastexitcode
}
-cd ..
\ No newline at end of file
+cd ..