Skip to content

Commit

Permalink
Make cross compile configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkroh committed Dec 3, 2015
1 parent 123b4b6 commit f8e6e9f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 116 deletions.
20 changes: 12 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ os:
- osx

env:
- TARGETS="check"
# - TARGETS="testsuite ES_HOST=elasticsearch-173"
- TARGETS="-C libbeat testsuite ES_HOST=elasticsearch-210"
- TARGETS="-C topbeat testsuite"
- TARGETS="-C filebeat testsuite"
- TARGETS="-C packetbeat testsuite"
- TARGETS="-C libbeat crosscompile"
- TARGETS="-C filebeat crosscompile"
matrix:
- TARGETS="check"
# - TARGETS="testsuite ES_HOST=elasticsearch-173"
- TARGETS="-C libbeat testsuite ES_HOST=elasticsearch-210"
- TARGETS="-C topbeat testsuite"
- TARGETS="-C filebeat testsuite"
- TARGETS="-C packetbeat testsuite"
- TARGETS="-C libbeat crosscompile"
- TARGETS="-C filebeat crosscompile"
global:
# Cross-compile for amd64 only to speed up testing.
- GOX_FLAGS="-arch amd64"

matrix:
exclude:
Expand Down
8 changes: 5 additions & 3 deletions libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ TIMEOUT?= 90
BEATNAME?=libbeat
TEST_ENVIRONMENT?=false
SYSTEM_TESTS?=false
GOX_OS?=linux darwin windows solaris freebsd netbsd openbsd


### BUILDING ###
Expand All @@ -28,12 +29,13 @@ build: $(GOFILES)
libbeat.test: $(GOFILES)
go test -c -covermode=atomic -coverpkg ./...

# Cross-compile beat for the OS and architectures listed in
# crosscompile.bash. The binaries are placed in the ./bin dir.
# Cross-compile beat for the OS'es specified in GOX_OS variable.
# The binaries are placed in the build/bin directory.
.PHONY: crosscompile
crosscompile: $(GOFILES)
go get github.com/mitchellh/gox
mkdir -p ${BUILD_DIR}/bin
source ../libbeat/scripts/crosscompile.bash; OUT='${BUILD_DIR}/bin' go-build-all
gox -output="${BUILD_DIR}/bin/{{.Dir}}-{{.OS}}-{{.Arch}}" -os="${GOX_OS}" ${GOX_FLAGS}

# Checks project and source code if everything is according to standard
.PHONY: check
Expand Down
105 changes: 0 additions & 105 deletions libbeat/scripts/crosscompile.bash

This file was deleted.

3 changes: 3 additions & 0 deletions topbeat/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
BEATNAME=topbeat
SYSTEM_TESTS=true

# Only crosscompile for linux because other OS'es use cgo.
GOX_OS=linux

include ../libbeat/scripts/Makefile

.PHONY: install-cfg
Expand Down
1 change: 1 addition & 0 deletions winlogbeat/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
BEATNAME=winlogbeat
SYSTEM_TESTS=true
TEST_ENVIRONMENT=false
GOX_OS=windows

include ../libbeat/scripts/Makefile

Expand Down

0 comments on commit f8e6e9f

Please sign in to comment.