mirror of
https://github.com/shouptech/humulus.git
synced 2026-02-03 19:29:41 +00:00
65 lines
1.1 KiB
YAML
65 lines
1.1 KiB
YAML
kind: pipeline
|
|
name: test
|
|
|
|
services:
|
|
- name: couchdb
|
|
image: couchdb:2.3
|
|
environment:
|
|
COUCHDB_USER: admin
|
|
COUCHDB_PASSWORD: password
|
|
|
|
steps:
|
|
- name: test
|
|
image: python:3.6
|
|
environment:
|
|
COUCH_URL: 'http://couchdb:5984'
|
|
CODECOV_TOKEN:
|
|
from_secret: CODECOV_TOKEN
|
|
commands:
|
|
# Install pre-requisites
|
|
- pip install coverage pytest
|
|
- pip install -e .
|
|
# Wait for couch
|
|
- until curl "$COUCH_URL" ; do sleep 1 ; done
|
|
# Run tests
|
|
- coverage run -m pytest
|
|
- coverage report -m
|
|
# Upload coverage report
|
|
- pip install codecov
|
|
- codecov
|
|
|
|
---
|
|
kind: pipeline
|
|
name: publish
|
|
|
|
steps:
|
|
- name: docker
|
|
image: plugins/docker
|
|
settings:
|
|
username:
|
|
from_secret: DOCKER_USERNAME
|
|
password:
|
|
from_secret: DOCKER_PASSWORD
|
|
repo: shouptech/humulus
|
|
tags:
|
|
- latest
|
|
when:
|
|
branch:
|
|
- master
|
|
|
|
- name: docker
|
|
image: plugins/docker
|
|
settings:
|
|
username:
|
|
from_secret: DOCKER_USERNAME
|
|
password:
|
|
from_secret: DOCKER_PASSWORD
|
|
repo: shouptech/humulus
|
|
tags:
|
|
- ${DRONE_TAG}
|
|
when:
|
|
event:
|
|
- tag
|
|
|
|
depends_on:
|
|
- test
|