Git Product home page Git Product logo

drone-waiton's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.