206 lines
5.6 KiB
YAML
206 lines
5.6 KiB
YAML
|
sudo: required
|
||
|
dist: trusty
|
||
|
services:
|
||
|
- docker
|
||
|
|
||
|
language: go
|
||
|
|
||
|
# Make sure project can also be built on travis for clones of the repo
|
||
|
go_import_path: github.com/elastic/beats
|
||
|
|
||
|
env:
|
||
|
global:
|
||
|
# Cross-compile for amd64 only to speed up testing.
|
||
|
- GOX_FLAGS="-arch amd64"
|
||
|
- DOCKER_COMPOSE_VERSION=1.11.1
|
||
|
- GO_VERSION="$(cat .go-version)"
|
||
|
# Newer versions of minikube fail on travis, see: https://github.com/kubernetes/minikube/issues/2704
|
||
|
- TRAVIS_MINIKUBE_VERSION=v0.25.2
|
||
|
|
||
|
jobs:
|
||
|
include:
|
||
|
# General checks
|
||
|
- os: linux
|
||
|
env: TARGETS="check"
|
||
|
go: $GO_VERSION
|
||
|
stage: check
|
||
|
|
||
|
# Filebeat
|
||
|
- os: linux
|
||
|
env: TARGETS="-C filebeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
- os: osx
|
||
|
env: TARGETS="TEST_ENVIRONMENT=0 -C filebeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
# Heartbeat
|
||
|
- os: linux
|
||
|
env: TARGETS="-C heartbeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
- os: osx
|
||
|
env: TARGETS="TEST_ENVIRONMENT=0 -C heartbeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
# Auditbeat
|
||
|
- os: linux
|
||
|
env: TARGETS="-C auditbeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
- os: osx
|
||
|
env: TARGETS="TEST_ENVIRONMENT=0 -C auditbeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
- os: linux
|
||
|
env: TARGETS="-C auditbeat crosscompile"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
# Libbeat
|
||
|
- os: linux
|
||
|
env: TARGETS="-C libbeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
- os: linux
|
||
|
env: TARGETS="-C libbeat crosscompile"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
- os: linux
|
||
|
env: STRESS_TEST_OPTIONS="-timeout=20m -race -v -parallel 1" TARGETS="-C libbeat stress-tests"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
# Metricbeat
|
||
|
- os: linux
|
||
|
env: TARGETS="-C metricbeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
- os: osx
|
||
|
env: TARGETS="TEST_ENVIRONMENT=0 -C metricbeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
- os: linux
|
||
|
env: TARGETS="-C metricbeat crosscompile"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
# Packetbeat
|
||
|
- os: linux
|
||
|
env: TARGETS="-C packetbeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
# Winlogbeat
|
||
|
- os: linux
|
||
|
env: TARGETS="-C winlogbeat crosscompile"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
# Journalbeat
|
||
|
- os: linux
|
||
|
env: TARGETS="-C journalbeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
# Functionbeat
|
||
|
- os: linux
|
||
|
env: TARGETS="-C x-pack/functionbeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
- os: osx
|
||
|
env: TARGETS="TEST_ENVIRONMENT=0 -C x-pack/functionbeat testsuite"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
# Generators
|
||
|
- os: linux
|
||
|
env: TARGETS="-C generator/metricbeat test"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
- os: linux
|
||
|
env: TARGETS="-C generator/beat test"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
# Docs
|
||
|
- os: linux
|
||
|
env: TARGETS="docs"
|
||
|
go: $GO_VERSION
|
||
|
stage: test
|
||
|
|
||
|
# Kubernetes
|
||
|
- os: linux
|
||
|
install: deploy/kubernetes/.travis/setup.sh
|
||
|
env:
|
||
|
- TARGETS="-C deploy/kubernetes test"
|
||
|
- TRAVIS_K8S_VERSION=v1.8.0
|
||
|
stage: test
|
||
|
- os: linux
|
||
|
install: deploy/kubernetes/.travis/setup.sh
|
||
|
env:
|
||
|
- TARGETS="-C deploy/kubernetes test"
|
||
|
- TRAVIS_K8S_VERSION=v1.9.4
|
||
|
stage: test
|
||
|
- os: linux
|
||
|
install: deploy/kubernetes/.travis/setup.sh
|
||
|
env:
|
||
|
- TARGETS="-C deploy/kubernetes test"
|
||
|
- TRAVIS_K8S_VERSION=v1.10.0
|
||
|
stage: test
|
||
|
# TODO include 1.11 once minikube supports it
|
||
|
#- os: linux
|
||
|
# install: deploy/kubernetes/.travis/setup.sh
|
||
|
# env:
|
||
|
# - TARGETS="-C deploy/kubernetes test"
|
||
|
# - TRAVIS_K8S_VERSION=v1.11.0
|
||
|
# stage: test
|
||
|
|
||
|
addons:
|
||
|
apt:
|
||
|
update: true
|
||
|
packages:
|
||
|
- python-virtualenv
|
||
|
- libpcap-dev
|
||
|
- xsltproc
|
||
|
- libxml2-utils
|
||
|
- libsystemd-journal-dev
|
||
|
|
||
|
before_install:
|
||
|
- python --version
|
||
|
- umask 022
|
||
|
- chmod -R go-w $GOPATH/src/github.com/elastic/beats
|
||
|
# Docker-compose installation
|
||
|
- sudo rm /usr/local/bin/docker-compose || true
|
||
|
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
|
||
|
- chmod +x docker-compose
|
||
|
- sudo mv docker-compose /usr/local/bin
|
||
|
- if [ $TRAVIS_OS_NAME = osx ]; then pip install virtualenv; fi
|
||
|
|
||
|
|
||
|
# Skips installations step
|
||
|
install: true
|
||
|
|
||
|
script:
|
||
|
- make $TARGETS
|
||
|
|
||
|
notifications:
|
||
|
slack:
|
||
|
on_success: change
|
||
|
on_failure: always
|
||
|
on_pull_requests: false
|
||
|
rooms:
|
||
|
secure: "e25J5puEA31dOooTI4T+K+zrTs8XeWIGq2cgmiPt9u/g7eqWeQj1UJnVsr8GOu1RPDyuJZJHXqfrvuOYJTdHzXbwjD0JTbwwVVZMkkZW2SWZHG46HCXPiucjWXEr3hXJKBJDDpIx6VxrN7r17dejv1biQ8QuEFZfiB1H8kbH/ho="
|
||
|
|
||
|
after_success:
|
||
|
# Copy full.cov to coverage.txt because codecov.io requires this file
|
||
|
- test -f auditbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f auditbeat/build/coverage/full.cov
|
||
|
- test -f filebeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f filebeat/build/coverage/full.cov
|
||
|
- test -f heartbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f heartbeat/build/coverage/full.cov
|
||
|
- test -f libbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f libbeat/build/coverage/full.cov
|
||
|
- test -f metricbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f metricbeat/build/coverage/full.cov
|
||
|
- test -f packetbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f packetbeat/build/coverage/full.cov
|