Skip to content

akhenakh/drone-waiton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drone-waiton

A drone plugin to wait for external hosts to be available, useful for CI when waiting on a service.

In this example pipeline, we spawn a redis service, ask waiton to test for redis avaibility, and then do our work in a task depending on waiton.

kind: pipeline

steps:
- name: waiton
  image: akhenakh/drone-waiton:1.0
  settings:
    globaltimeout: 30s
    urls:
    - tcp://cache:6379

- name: service-ready
  image: busybox
  commands:
  - echo "redis ready"
  depends_on:
  - waiton

services:
- name: cache
  image: redis
  ports:
  - 6379

Settings

urls

type []string

default ''

description List of URLs to test, supported schema are http://, https:// and tcp://.

example

# .drone.yml

kind: pipeline

steps:
- name: waiton
  image: akhenakh/drone-waiton
  settings:
    urls:
    - http://www.google.com
    - http://httpbin.org/delay/5

globaltimeout

type string

default '1m'

description Duration before a timeout error is returned, if tests are not completed yet.

note Duration can be expressed in minute m, seconds s ...

example

# .drone.yml
# this pipeline will fail because the url will return in 5s but the globaltimeout is set to 3s

kind: pipeline

steps:
- name: waiton
  image: akhenakh/drone-waiton
  settings:
    globaltimeout: 3s
    urls:
    - http://httpbin.org/delay/5

urltimeout

type string

default '10s'

description Duration before timeouting a single request and retrying.

note Duration can be expressed in minute m, seconds s ...

example

# .drone.yml

kind: pipeline

steps:
- name: waiton
  image: akhenakh/drone-waiton
  settings:
    urltimeout: 3s
    urls:
    - http://httpbin.org/delay/2

maxretries

type int

default '100'

description Number of retries before failing.

example

# .drone.yml

kind: pipeline

steps:
- name: waiton
  image: akhenakh/drone-waiton
  settings:
    urltimeout: 1m
    maxretries: 10
    urls:
    - http://httpbin.org/delay/2

Details

The waiton docker image is 4.2MB compressed, based on a distroless image with a simple Go program.

For HTTP & TCP, waiton wll retry every 1s as a backoff strategy.

About

A drone plugin to wait on services availability

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published