forked from splunk/splunk-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
48 lines (39 loc) · 1.37 KB
/
.travis.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
notifications:
email: false
sudo: required
services:
- docker
before_install:
# Create .splunkrc file with default credentials
- echo host=localhost >> $HOME/.splunkrc
- echo username=admin >> $HOME/.splunkrc
- echo password=changeme >> $HOME/.splunkrc
# Set env vars for TCP/UDP tests (we've punched these through Docker)
- export TEST_TCP_PORT=10667
- export TEST_UDP_PORT=10668
# Set SPLUNK_HOME
- export SPLUNK_HOME="/opt/splunk"
# Pull docker image
- docker pull splunk/splunk-sdk-travis-ci:$SPLUNK_VERSION
# Add DOCKER to iptables, 1/10 times this is needed, force 0 exit status
- sudo iptables -N DOCKER || true
# Start Docker container
- docker run -p 127.0.0.1:8089:8089 -p 127.0.0.1:$TEST_TCP_PORT:$TEST_TCP_PORT -p 127.0.0.1:$TEST_UDP_PORT:$TEST_UDP_PORT/udp -d splunk/splunk-sdk-travis-ci:$SPLUNK_VERSION
# curl Splunk until it returns valid data indicating it has been setup, try 20 times maximum
- for i in `seq 0 20`; do if curl --fail -k https://localhost:8089/services/server/info &> /dev/null; then break; fi; echo $i; sleep 1; done
# Additional sleep to make sure splunkd is
- sleep 30
env:
- SPLUNK_VERSION=6.6-sdk
- SPLUNK_VERSION=7.0-sdk
language: java
addons:
apt:
packages:
- ant-optional
jdk:
- oraclejdk8
- openjdk7
before_script:
- ant
script: ant travis