mirror of https://github.com/Icinga/icinga2.git
Add AppVeyor definition
This commit is contained in:
parent
b20c3ec61a
commit
4a1375cc5f
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
version: 2.9.0.dev.{build}
|
||||
|
||||
os: Visual Studio 2017
|
||||
|
||||
environment:
|
||||
CMAKE_GENERATOR: "Visual Studio 15 2017 Win64"
|
||||
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'
|
||||
FLEX_BINARY: 'C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_flex.exe'
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
cache:
|
||||
- build
|
||||
- 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) }
|
||||
}
|
||||
|
||||
before_build:
|
||||
- ps: |
|
||||
.\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) }
|
||||
|
||||
test_script:
|
||||
- ps: |
|
||||
.\tools\win32\test.ps1
|
||||
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
|
||||
|
||||
artifacts:
|
||||
- path: build/Icinga*.msi
|
||||
- path: build/choco/*.nupkg
|
||||
- path: build/Test.xml
|
||||
|
||||
deploy: off
|
|
@ -1,18 +1,19 @@
|
|||
[string]$pwd = Get-Location
|
||||
$OpenSSL_version = '1.1.0g'
|
||||
$OpenSSL_version = '1.1.0g-1'
|
||||
$OpenSSL_arch = 'x64'
|
||||
$OpenSSL_vcbuild = 'vc150'
|
||||
$OpenSSL_fileversion = $OpenSSL_version.Replace('.', '_')
|
||||
$OpenSSL_fileversion = $OpenSSL_version.Replace('.', '_').Split('-')[0]
|
||||
$OpenSSL_file = [string]::Format(
|
||||
'openssl-{0}-binary-icinga-{1}-{2}.zip',
|
||||
$OpenSSL_fileversion,
|
||||
$OpenSSL_arch,
|
||||
$OpenSSL_vcbuild
|
||||
)
|
||||
|
||||
# TODO: from GitHub Release!
|
||||
#$OpenSSL_url = ''
|
||||
$OpenSSL_url = 'https://ci.appveyor.com/api/buildjobs/4hwjjxgvvyeplrjd/artifacts/' + $OpenSSL_file
|
||||
$OpenSSL_url = [string]::Format(
|
||||
'https://github.com/Icinga/openssl-windows/releases/download/v{0}/{1}',
|
||||
$OpenSSL_version,
|
||||
$OpenSSL_file
|
||||
)
|
||||
|
||||
$OpenSSL_zip_location = $pwd + '\vendor\' + $OpenSSL_file
|
||||
$vendor_path = $pwd + '\vendor'
|
||||
|
@ -26,6 +27,7 @@ if (Test-Path $OpenSSL_zip_location) {
|
|||
Write-Output "OpenSSL archive available at $OpenSSL_zip_location"
|
||||
} else {
|
||||
Write-Output "Downloading OpenSSL binary dist from $OpenSSL_url"
|
||||
|
||||
$progressPreference = 'silentlyContinue'
|
||||
Invoke-WebRequest -Uri $OpenSSL_url -OutFile $OpenSSL_zip_location
|
||||
if ($lastexitcode -ne 0){ exit $lastexitcode }
|
||||
|
@ -38,11 +40,11 @@ if (Test-Path $OpenSSL_zip_location) {
|
|||
|
||||
if (-not (Test-Path $OpenSSL_vendor_path)) {
|
||||
mkdir $OpenSSL_vendor_path
|
||||
}
|
||||
|
||||
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 }
|
||||
|
||||
exit 0
|
||||
} else {
|
||||
Write-Output "OpenSSL is already available at $OpenSSL_vendor_path"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
[string]$pwd = Get-Location
|
||||
|
||||
if (-not (Test-Path build)) {
|
||||
Write-Host "Path '$pwd\build' does not exist!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if (-not (Test-Path env:CMAKE_PATH)) {
|
||||
$env:CMAKE_PATH = 'C:\Program Files\CMake\bin'
|
||||
}
|
||||
if (-not ($env:PATH -contains $env:CMAKE_PATH)) {
|
||||
$env:PATH = $env:CMAKE_PATH + ';' + $env:PATH
|
||||
}
|
||||
|
||||
cd build
|
||||
|
||||
ctest.exe -C RelWithDebInfo -T test -O build/Test.xml --output-on-failure
|
||||
if ($lastexitcode -ne 0) {
|
||||
cd ..
|
||||
exit $lastexitcode
|
||||
}
|
||||
|
||||
cd ..
|
Loading…
Reference in New Issue