You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

86 lines
2.7 KiB

---
# drone -s https://<DRONE SERVER> -t <USER TOKEN> sign scrippy/scrippy-db --save
kind: pipeline
type: docker
name: Scrippy/scrippy-db
steps:
- name: Test
image: python
environment:
db_connexion_string: postgres://postgres:postgres@scrippy_db:5432/scrippy
commands:
- apt-get update
- apt-get install postgresql-client -y
- psql -Atx $${db_connexion_string} -f ./tests/sql/feed_db.sql
- python -m pip install pip --upgrade
- python -m pip install .[dev]
- python3 -m pytest -s --cov=scrippy_db --junitxml=./junit_report.xml
when:
event:
exclude:
- tag
- name: Build and publish
image: python
environment:
badge_url: '![Build Status](https://drone.mcos.nc/api/badges/scrippy/scrippy-db/status.svg) ![License](https://img.shields.io/static/v1?label=license&color=orange&message=WTFPL) ![Language](https://img.shields.io/static/v1?label=language&color=informational&message=Python)'
pip_user:
from_secret: pip_user
pip_password:
from_secret: pip_password
commands:
- rm -Rf ./build ./dist ./scrippy_db.egg-info ./scrippy_db/__pycache__ ./tests/__pycache__ ./junit_report.xml ./.coverage
- find ./ -maxdepth 3 -type d -name "*__pycache__*" -exec rm -Rf {} \;
- python -m pip install pip --upgrade
- python -m pip install .[dev]
- git push --set-upstream origin master
- bump2version patch
- VERSION=$(grep ^current_version ./.bumpversion.cfg | cut -d\ -f3);
- SCORE=$(pylint ./scrippy_db/* --exit-zero --confidence=HIGH -f parseable | tail -n2 | head -n1 | cut -d\ -f7)
- sed -i "1c \![version](https://img.shields.io/static/v1?label=version&color=informational&message=$${VERSION}) ![pylint](https://img.shields.io/static/v1?label=pylint&color=informational&message=$${SCORE}) $${badge_url}" README.md
- git add setup.cfg .bumpversion.cfg README.md
- git commit -m 'Increment version [CI SKIP]'
- pypirc -s local -u $${pip_user} -p $${pip_password} -r https://pip.mcos.nc
- python3 setup.py sdist bdist_wheel register -r local upload -r local
- git push origin
depends_on:
- Test
when:
branch: master
event:
exclude:
- pull_request
- tag
- name: Tag
image: python
commands:
- python -m pip install pip --upgrade
- VERSION=$(grep ^current_version ./.bumpversion.cfg | cut -d\ -f3);
- git tag $${VERSION}
- git push origin $${VERSION}
depends_on:
- Build and publish
when:
branch: master
event:
exclude:
- tag
- pull_request
services:
- name: scrippy_db
image: scrippy_db
pull: never
ports:
- 5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: scrippy
---
kind: signature
hmac: bcc2588815cf76542e18ff260cb14bc98293bc634b62572b93919960f9221c4d
...