Example Redis Configuration

Updated 2 years ago by Admin

This guide covers configuring continuous integration pipelines for projects that have a Redis 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 Redis service container. The server can be reached at localhost:6379.

   1  kind: pipeline
2 type: kubernetes
3 name: default
4
5 steps:
6 - name: test
7 image: redis
8 commands:
9 - sleep 5
10 - redis-cli -h localhost ping
11 - redis-cli -h localhost set FOO bar
12 - redis-cli -h localhost get FOO
13
14 services:
15 - name: redis
16 image: redis

Common Problems

If you are unable to connect to the Redis container please make sure you are giving Redis 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: redis
8 commands:
9 - sleep 15
10 - redis-cli -h localhost ping


How did we do?