enable drone ci

This commit is contained in:
Robert Kaussow 2020-02-03 16:51:44 +01:00
parent a0c1ff730b
commit 03386ff56c
4 changed files with 64 additions and 21 deletions

60
.drone.yml Normal file
View File

@ -0,0 +1,60 @@
---
kind: pipeline
type: docker
name: testing
platform:
os: linux
arch: amd64
steps:
- name: test
image: bats/bats
commands:
- bats ./wait-for.bats
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
---
kind: pipeline
type: docker
name: notification
platform:
os: linux
arch: amd64
steps:
- name: matrix
image: plugins/matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
username:
from_secret: matrix_username
trigger:
ref:
- refs/heads/master
- refs/tags/**
status:
- success
- failure
depends_on:
- testing
---
kind: signature
hmac: 495a8f60228b02351858fb8226da326dfacb1cfb3a749143a3d89218782e335b
...

View File

@ -1,11 +0,0 @@
FROM node:alpine
RUN apk add --no-cache bash
RUN mkdir -p /app
WORKDIR /app
COPY . /app
RUN npm install
CMD ./node_modules/.bin/bats wait-for.bats

View File

@ -1,5 +1,8 @@
# wait-for
[![Build Status](https://img.shields.io/drone/build/xoxys/wait-for?logo=drone)](https://cloud.drone.io/xoxys/wait-for)
[![License: MIT](https://img.shields.io/github/license/xoxys/wait-for)](LICENSE)
`./wait-for` is a script designed to synchronize services like docker containers. It is [sh](https://en.wikipedia.org/wiki/Bourne_shell) and [alpine](https://alpinelinux.org/) compatible. It was inspired by [vishnubob/wait-for-it](https://github.com/vishnubob/wait-for-it), but the core has been rewritten at [Eficode](http://eficode.com/) by [dsuni](https://github.com/dsuni) and [mrako](https://github.com/mrako).
When using this tool, you only need to pick the `wait-for` file as part of your project.
@ -44,15 +47,6 @@ services:
- db
```
## Testing
Ironically testing is done using [bats](https://github.com/sstephenson/bats), which on the other hand is depending on [bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)).
```Shell
docker build -t wait-for .
docker run -t wait-for
```
### License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

View File

@ -2,7 +2,7 @@
@test "google should be immediately found" {
run ./wait-for google.com:80 -- echo 'success'
[ "$output" = "success" ]
}