Skip to content

Commit 7ff830d

Browse files
committed
Install sdk-app-collection via docker-compose
1 parent 5f80fbd commit 7ff830d

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

.travis.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ before_install:
1212
- echo password=changed! >> $HOME/.splunkrc
1313
# Set SPLUNK_HOME
1414
- export SPLUNK_HOME="/opt/splunk"
15-
# Pull docker image
16-
- docker pull splunk/splunk-sdk-travis-ci:$SPLUNK_VERSION
1715
# Add DOCKER to iptables, 1/10 times this is needed, force 0 exit status
1816
- sudo iptables -N DOCKER || true
19-
# Start Docker container
20-
- docker run -p 127.0.0.1:8089:8089 -d splunk/splunk-sdk-travis-ci:$SPLUNK_VERSION
21-
# curl Splunk until it returns valid data indicating it has been setup, try 20 times maximum
22-
- 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
17+
# Start docker-compose in detached mode
18+
- docker-compose up -d
19+
# Health Check (3 minutes)
20+
- for i in `seq 0 180`; do if docker exec -it splunk /sbin/checkstate.sh &> /dev/null; then break; fi; echo $i; sleep 1; done
2321
# The upload test needs to refer to a file that Splunk has in the docker
2422
# container
2523
- export INPUT_EXAMPLE_UPLOAD=$SPLUNK_HOME/var/log/splunk/splunkd_ui_access.log
@@ -32,8 +30,8 @@ before_install:
3230
language: python
3331

3432
env:
35-
- SPLUNK_VERSION=7.3-sdk
36-
- SPLUNK_VERSION=8.0-sdk
33+
- SPLUNK_VERSION=7.3
34+
- SPLUNK_VERSION=8.0
3735

3836
python:
3937
- "2.7"

docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: '3.6'
2+
3+
services:
4+
splunk:
5+
image: "splunk/splunk:${SPLUNK_VERSION}"
6+
container_name: splunk
7+
environment:
8+
- SPLUNK_START_ARGS=--accept-license
9+
- SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
10+
- SPLUNK_PASSWORD=changed!
11+
- SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.0.0/sdk-app-collection.tgz
12+
ports:
13+
- 8000:8000
14+
- 8088:8088
15+
- 8089:8089
16+
healthcheck:
17+
test: ['CMD', 'curl', '-f', 'http://localhost:8000']
18+
interval: 5s
19+
timeout: 5s
20+
retries: 20

0 commit comments

Comments
 (0)