Example Elasicsearch Configuration
This guide covers configuring continuous integration pipelines for projects that have a Elasticsearch dependency. If you’re new to Drone please read our Tutorial and build configuration guides first.
Basic Example
In the below example we demonstrate a pipeline that launches a Elasticsearch service container. The server will be available at localhost:9200
.
1 ---
2 kind: pipeline
3 type: kubernetes
4 name: default
5
6 platform:
7 os: linux
8 arch: amd64
9
10 steps:
11 - name: test
12 image: alpine:3.8
13 commands:
14 - apk add curl
15 - sleep 45
16 - curl http://localhost:9200
17
18 services:
19 - name: database
20 image: elasticsearch:5-alpine
21
22 ...
Common Problems
If you are unable to connect to the Elastic container please make sure you are giving the instance adequate time to initialize and begin accepting connections.
1 kind: pipeline
2 type: kubernetes
3 name: default
4
5 steps:
6 - name: test
7 image: alpine:3.8
8 commands:
9 - apk add curl
10 - sleep 45
11 - curl http://localhost:9200