]> granicus.if.org Git - icinga2/commitdiff
Add AppVeyor definition
authorMarkus Frosch <markus.frosch@icinga.com>
Fri, 2 Feb 2018 16:22:15 +0000 (17:22 +0100)
committerMarkus Frosch <markus.frosch@icinga.com>
Wed, 7 Feb 2018 19:30:36 +0000 (20:30 +0100)
appveyor.yml [new file with mode: 0644]
tools/win32/download-openssl.ps1
tools/win32/test.ps1 [new file with mode: 0644]

diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644 (file)
index 0000000..415bf70
--- /dev/null
@@ -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
index 466e661c886f140641467c46e0ca068ad3c3025a..1ebe348f952d1fca406fabffd8a148b4f53c6b47 100644 (file)
@@ -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'
@@ -23,11 +24,12 @@ if (-not (Test-Path $vendor_path)) {
 }
 
 if (Test-Path $OpenSSL_zip_location) {
-    Write-Output "OpenSSL archive available at $OpenSSL_zip_location"
+  Write-Output "OpenSSL archive available at $OpenSSL_zip_location"
 } else {
-    Write-Output "Downloading OpenSSL binary dist from $OpenSSL_url"
+  Write-Output "Downloading OpenSSL binary dist from $OpenSSL_url"
+
   $progressPreference = 'silentlyContinue'
-    Invoke-WebRequest -Uri $OpenSSL_url -OutFile $OpenSSL_zip_location
+  Invoke-WebRequest -Uri $OpenSSL_url -OutFile $OpenSSL_zip_location
   if ($lastexitcode -ne 0){ exit $lastexitcode }
   $progressPreference = 'Continue'
   
@@ -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
+  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 }  
+} else {
+  Write-Output "OpenSSL is already available at $OpenSSL_vendor_path"
+}
diff --git a/tools/win32/test.ps1 b/tools/win32/test.ps1
new file mode 100644 (file)
index 0000000..913c82c
--- /dev/null
@@ -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 ..
\ No newline at end of file