Drone CI 中文文档

Example Nats Configuration

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
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
kind: pipeline
name: default

steps:
- name: test
  image: ruby:2
  commands:
  - gem install nats
  - nats-pub -s tcp://nats:4222 greeting 'hello'
  - nats-pub -s tcp://nats:4222 greeting 'world'

services:
- name: nats
  image: nats:1.3.0