https://github.com/akhenakh/drone-waiton
A drone plugin to wait on services availability
https://github.com/akhenakh/drone-waiton
cicd drone drone-ci drone-plugin
Last synced: 7 months ago
JSON representation
A drone plugin to wait on services availability
- Host: GitHub
- URL: https://github.com/akhenakh/drone-waiton
- Owner: akhenakh
- License: mit
- Created: 2020-06-04T03:43:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-08T00:48:16.000Z (over 3 years ago)
- Last Synced: 2025-01-30T12:46:54.532Z (8 months ago)
- Topics: cicd, drone, drone-ci, drone-plugin
- Language: Dockerfile
- Homepage:
- Size: 17.6 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
```yaml
kind: pipelinesteps:
- 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:
- waitonservices:
- 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**_
```yaml
# .drone.ymlkind: 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**_
```yaml
# .drone.yml
# this pipeline will fail because the url will return in 5s but the globaltimeout is set to 3skind: 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**_
```yaml
# .drone.ymlkind: 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**_
```yaml
# .drone.ymlkind: 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](https://github.com/akhenakh/waiton).
For HTTP & TCP, waiton wll retry every 1s as a backoff strategy.