Example Nats Configuration

Updated 2 years ago by Admin

This guide covers configuring continuous integration pipelines for projects that have a Nats 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 Nats service container. The nats service will be available at nats:4222, where the hostname matches the service container name.

1   kind: pipeline
2 name: default
4 steps:
5 - name: test
6 image: ruby:2
7 commands:
8 - gem install nats
9 - nats-pub -s tcp://nats:4222 greeting 'hello'
10 - nats-pub -s tcp://nats:4222 greeting 'world'
12 services:
13 - name: nats
14 image: nats:1.3.0

How did we do?