forked from deviantony/docker-elk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
77 lines (68 loc) · 3.18 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
language: minimal
services: docker
env:
- DOCKER_COMPOSE_VERSION=1.20.1
before_install:
- sudo apt-get update
- sudo apt-get install -y expect jq
install:
# Install Docker Compose
- curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o "$HOME/bin/docker-compose"
- chmod +x "$HOME/bin/docker-compose"
- docker-compose --version
before_script:
# Build images
- docker-compose build
# Use built-in users with passwords set by 'elasticsearch-setup-passwords.exp'
- sed -i -e 's/\(elasticsearch.username:\) elastic/\1 kibana/g' -e 's/\(elasticsearch.password:\) changeme/\1 testpasswd/g' kibana/config/kibana.yml
- sed -i -e 's/\(xpack.monitoring.elasticsearch.username:\) elastic/\1 logstash_system/g' -e 's/\(xpack.monitoring.elasticsearch.password:\) changeme/\1 testpasswd/g' logstash/config/logstash.yml
- sed -i 's/\(password =>\) "changeme"/\1 "testpasswd"/g' logstash/pipeline/logstash.conf
- sed -i 's/\(elasticsearch.password:\) changeme/\1 testpasswd/g' extensions/app-search/config/app-search.yml
- sed -i 's/\(password:\) changeme/\1 testpasswd/g' extensions/apm-server/config/apm-server.yml
script:
# Core Elastic Stack
- docker-compose up -d elasticsearch
- sleep 30
- .travis/elasticsearch-setup-passwords.exp
- docker-compose up -d
- .travis/run-tests-core.sh
- docker-compose ps
- docker-compose logs elasticsearch
- docker-compose logs kibana
- docker-compose logs logstash
- docker-compose stop logstash kibana
# Extensions
# App Search
- docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml up -d app-search
- .travis/run-tests-app-search.sh
- docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml ps
- docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml logs app-search
- docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml stop app-search
# APM Server
- docker-compose -f docker-compose.yml -f extensions/apm-server/apm-server-compose.yml up -d apm-server
- .travis/run-tests-apm-server.sh
- docker-compose -f docker-compose.yml -f extensions/apm-server/apm-server-compose.yml ps
- docker-compose -f docker-compose.yml -f extensions/apm-server/apm-server-compose.yml logs apm-server
- docker-compose -f docker-compose.yml -f extensions/apm-server/apm-server-compose.yml stop apm-server
# Tear down
- >-
docker-compose
-f docker-compose.yml
-f extensions/app-search/app-search-compose.yml
-f extensions/apm-server/apm-server-compose.yml
down -v
# Swarm
- docker swarm init
- docker stack deploy -c ./docker-stack.yml elk
- docker service scale elk_kibana=0 --detach=false
- docker service scale elk_logstash=0 --detach=false
- sleep 40
- .travis/elasticsearch-setup-passwords.exp swarm
- docker service scale elk_kibana=1 --detach=false
- docker service scale elk_logstash=1 --detach=false
- .travis/run-tests-core.sh swarm
- docker stack services elk
- docker service logs elk_elasticsearch
- docker service logs elk_kibana
- docker service logs elk_logstash
- docker stack rm elk