forked from fstab/grok_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
72 lines (55 loc) · 2.49 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
version:
"{build}"
os:
Windows Server 2012 R2
clone_folder:
C:\go\src\github.com\fstab\grok_exporter
environment:
PATH: c:\go\bin;C:\msys64\mingw64\bin;%PATH%
GOPATH: c:\go
CC: x86_64-w64-mingw32-gcc
CGO_ENABLED: 1
CGO_LDFLAGS: C:\msys64\mingw64\lib\libonig.a
matrix:
- ONIG_VERSION: 5.9.6
# - ONIG_VERSION: 6.1.0
# --------------------------------------------------------------------------
# The install phase installs the Oniguruma library,
# which is a dependency for building grok_exporter.
# We use Cygwin and MinGW to cross-compile Oniguruma for Windows.
# --------------------------------------------------------------------------
install:
# Update the Cygwin environment
# Uncomment the following command to upgrade the cygwin packages:
# - C:\cygwin\setup-x86.exe -q -g
- C:\cygwin\bin\bash -lc "cygcheck -dc cygwin"
# Download and unpack Oniguruma sources
- cd C:\
- appveyor DownloadFile https://github.com/kkos/oniguruma/releases/download/v%ONIG_VERSION%/onig-%ONIG_VERSION%.tar.gz
- 7z x onig-%ONIG_VERSION%.tar.gz -so | 7z x -si -ttar > nul
- cd onig-%ONIG_VERSION%
# Compile Oniguruma using x86_64-w64-mingw32-gcc
- C:\cygwin\bin\bash -c "PATH='/usr/sbin:/usr/bin:/sbin:/bin' ./configure -v --host=x86_64-w64-mingw32 --prefix=/cygdrive/c/msys64/mingw64"
- C:\cygwin\bin\bash -c "PATH='/usr/sbin:/usr/bin:/sbin:/bin' make"
- C:\cygwin\bin\bash -c "PATH='/usr/sbin:/usr/bin:/sbin:/bin' make install"
# --------------------------------------------------------------------------
# The build phase compiles and tests grok_exporter.
# --------------------------------------------------------------------------
build_script:
- cd c:\go\src\github.com\fstab\grok_exporter
- git submodule update --init --recursive
- go version
- go test github.com/fstab/grok_exporter
- go test github.com/fstab/grok_exporter/exporter
- go test github.com/fstab/grok_exporter/tailer
- go install github.com/fstab/grok_exporter
- C:\cygwin\bin\bash -c "cd /cygdrive/c/go/src/github.com/fstab/grok_exporter ; PATH='/usr/sbin:/usr/bin:/sbin:/bin' ./integration-test.sh"
# Print the linked DLLs, so we can check that grok_exporter does not have
# a runtime dependency on Oniguruma.
- C:\cygwin\bin\bash -c "PATH='/usr/sbin:/usr/bin:/sbin:/bin' x86_64-w64-mingw32-objdump -p /cygdrive/c/go/bin/grok_exporter.exe | grep 'DLL Name:'"
# Success.
- grok_exporter -version
test:
off
deploy:
off