This repository has been archived by the owner on Sep 22, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
108 lines (96 loc) · 5.5 KB
/
.appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
version: 3.4.17.{build}
image: Visual Studio 2017
clone_folder: c:\projects\zabbix
shallow_clone: true
matrix:
fast_finish: false
platform:
- x64
#- x86
configuration:
- Release
environment:
matrix:
- PLATFORM: x64
BUILDER: CMake
GENERATOR: "NMake Makefiles"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PLATFORM: x86
BUILDER: CMake
GENERATOR: "NMake Makefiles"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
init:
- cmd: git config --global core.autocrlf input
- ps: 'Write-Host "Building Zabbix Next branch: $env:APPVEYOR_REPO_BRANCH" -ForegroundColor Magenta'
#- ps: |
# Write-Host "Build worker environment variables:" -ForegroundColor Magenta
# Get-ChildItem Env: | %{"{0}={1}" -f $_.Name,$_.Value}
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" if "%GENERATOR%"=="NMake Makefiles" if "%PLATFORM%"=="x86" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" if "%GENERATOR%"=="NMake Makefiles" if "%PLATFORM%"=="x64" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
install:
- set PCRE_VER=8.43
- mkdir C:\projects\deps
- mkdir C:\projects\deps\libs
- cd C:\projects\deps
- appveyor DownloadFile https://ftp.pcre.org/pub/pcre/pcre-%PCRE_VER%.zip -FileName pcre.zip
- 7z e -y pcre.zip -oC:\projects\deps\pcre
- mkdir C:\projects\deps\libs\pcre
build_script:
- if "%PLATFORM%"=="x86" set OPENSSL_PLATFORM=Win32
- if "%PLATFORM%"=="x64" set OPENSSL_PLATFORM=Win64
- if "%PLATFORM%"=="x86" set ZBX_PLATFORM=i386
- if "%PLATFORM%"=="x64" set ZBX_PLATFORM=AMD64
- if "%PLATFORM%"=="x86" set ZBX_OUTPUT=win32
- if "%PLATFORM%"=="x64" set ZBX_OUTPUT=win64
- if "%PLATFORM%"=="x86" set OPENSSL_DLL_1=libcrypto-1_1.dll
- if "%PLATFORM%"=="x86" set OPENSSL_DLL_2=libssl-1_1.dll
- if "%PLATFORM%"=="x64" set OPENSSL_DLL_1=libcrypto-1_1-x64.dll
- if "%PLATFORM%"=="x64" set OPENSSL_DLL_2=libssl-1_1-x64.dll
- ps: 'Write-Host "Running BUILDER: $env:BUILDER" -ForegroundColor Magenta'
- ps: 'Write-Host "Running GENERATOR: $env:GENERATOR" -ForegroundColor Magenta'
- ps: 'Write-Host "Running CONFIGURATION: $env:CONFIGURATION" -ForegroundColor Magenta'
- ps: 'Write-Host "Running OPENSSL_PLATFORM: $env:OPENSSL_PLATFORM" -ForegroundColor Magenta'
- ps: 'Write-Host "Running ZBX_PLATFORM: $env:ZBX_PLATFORM" -ForegroundColor Magenta'
- cd C:\projects\deps\pcre
- mkdir build
- cd build
- cmake -G "%GENERATOR%"
"-DCMAKE_BUILD_TYPE=%CONFIGURATION%"
"-DCMAKE_INSTALL_PREFIX=C:\projects\deps\libs\pcre"
"-DPCRE_BUILD_PCRECPP=OFF"
"-DPCRE_SUPPORT_UNICODE_PROPERTIES=ON"
"-DPCRE_SUPPORT_UTF=ON"
"-DCMAKE_C_FLAGS_RELEASE:string="/MT"" ..
- nmake install
- cd %APPVEYOR_BUILD_FOLDER%
- ps: |
$env:APPVEYOR_REPO_COMMIT_SHORT = $env:APPVEYOR_REPO_COMMIT.Substring(0, 8)
((Get-Content -path $env:APPVEYOR_BUILD_FOLDER\include\version.h -Raw) -replace '{ZABBIX_REVISION}',$env:APPVEYOR_REPO_COMMIT_SHORT) | Set-Content -Path $env:APPVEYOR_BUILD_FOLDER\include\version.h.new
if (Test-Path -Path $env:APPVEYOR_BUILD_FOLDER\include\version.h.new) {
Remove-Item -Path $env:APPVEYOR_BUILD_FOLDER\include\version.h -Force
Move-Item -Path $env:APPVEYOR_BUILD_FOLDER\include\version.h.new -Destination $env:APPVEYOR_BUILD_FOLDER\include\version.h
}
- ps: 'Write-Host "Running APPVEYOR_REPO_COMMIT_SHORT: $env:APPVEYOR_REPO_COMMIT_SHORT" -ForegroundColor Magenta'
- cd build\win32\project
- copy ..\include\config.h ..\..\..\include\ >nul 2>&1
- nmake CPU=%ZBX_PLATFORM% TLS=openssl TLSINCDIR="C:\OpenSSL-v111-%OPENSSL_PLATFORM%\include" TLSLIBDIR="C:\OpenSSL-v111-%OPENSSL_PLATFORM%\lib" PCREINCDIR="C:\projects\deps\libs\pcre\include" PCRELIBDIR="C:\projects\deps\libs\pcre\lib" /f Makefile_agent
- nmake CPU=%ZBX_PLATFORM% TLS=openssl TLSINCDIR="C:\OpenSSL-v111-%OPENSSL_PLATFORM%\include" TLSLIBDIR="C:\OpenSSL-v111-%OPENSSL_PLATFORM%\lib" PCREINCDIR="C:\projects\deps\libs\pcre\include" PCRELIBDIR="C:\projects\deps\libs\pcre\lib" /f Makefile_sender
- nmake CPU=%ZBX_PLATFORM% TLS=openssl TLSINCDIR="C:\OpenSSL-v111-%OPENSSL_PLATFORM%\include" TLSLIBDIR="C:\OpenSSL-v111-%OPENSSL_PLATFORM%\lib" PCREINCDIR="C:\projects\deps\libs\pcre\include" PCRELIBDIR="C:\projects\deps\libs\pcre\lib" /f Makefile_get
after_build:
- ps: 'Write-Host "Copy OPENSSL_DLL_1: $env:OPENSSL_DLL_1" -ForegroundColor Magenta'
- cmd: copy /Y C:\OpenSSL-v111-%OPENSSL_PLATFORM%\bin\%OPENSSL_DLL_1% C:\projects\zabbix\bin\%ZBX_OUTPUT%
- ps: 'Write-Host "Copy OPENSSL_DLL_2: $env:OPENSSL_DLL_2" -ForegroundColor Magenta'
- cmd: copy /Y C:\OpenSSL-v111-%OPENSSL_PLATFORM%\bin\%OPENSSL_DLL_2% C:\projects\zabbix\bin\%ZBX_OUTPUT%
- ps: 'Write-Host "Create archive zabbix-agent-$env:APPVEYOR_BUILD_VERSION-$env:PLATFORM.zip" -ForegroundColor Magenta'
- cd %APPVEYOR_BUILD_FOLDER%\bin
- cmd: 7z a zabbix-agent-%APPVEYOR_BUILD_VERSION%-%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\bin\%ZBX_OUTPUT%\*.exe %APPVEYOR_BUILD_FOLDER%\bin\%ZBX_OUTPUT%\*.dll
artifacts:
- path: bin\zabbix-agent-%APPVEYOR_BUILD_VERSION%-%PLATFORM%.zip
name: Zabbix agent v%APPVEYOR_BUILD_VERSION%-%PLATFORM% for Windows
notifications:
- provider: Email
to:
- sleuthhound@programs74.ru
on_build_success: false
on_build_failure: true
on_build_status_changed: true