Drone
Drone is a Docker-based CI server. All Systems projects at Vokal run through it before being merged into their staging environments. It is integrated with GitHub using a service hook, which triggers a drone build when a PR is opened to the master repo.
A drone build consists of a sequence of steps defined in the .drone.yml
, which should be defined on the top level of the repo. An example .drone.yml
would look like:
build:
image: python:3.5
environment:
- DATABASE_URL=postgres://postgres:whatever@127.0.0.1:5432/postgres
- SECRET_KEY=whatever
- REPO_OWNER=vokal
- REPO_NAME=my-repo-name
- ENVIRONMENT=drone
volumes:
- ./sql:/opt/flyway-3.2.1/sql/
commands:
- sleep 5
- pip install -r requirements.txt
- flyway -url=jdbc:postgresql://127.0.0.1:5432/postgres -locations=filesystem:./sql -user=postgres -password=whatever migrate
- nosetests -v --with-coverage --cover-package=app --cover-xml
- export CVR_URL="https://cvr.vokal.io/coverage?commit=$DRONE_COMMIT&owner=$REPO_OWNER&repo=$REPO_NAME&coveragetype=cobertura"
- curl -F coverage=@coverage.xml $CVR_URL
To get your repo added to drone contact one of the senior devs.