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.
 
 
 
 

80 lines
2.5 KiB

---
# drone -s https://<DRONE SERVER> -t <USER TOKEN> sign scrippy/scrippy-git --save
kind: pipeline
type: docker
name: Scrippy/scrippy-git
steps:
- name: Test
image: python
commands:
- chmod 700 ./tests/ssh
- chmod 600 ./tests/ssh/scrippy.rsa
- python -m pip install pip --upgrade
- python -m pip install .[dev]
- python3 -m pytest -s --cov=scrippy_git --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-git/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_git.egg-info ./scrippy_git/__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_git/* --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: gitolite
pull: never
image: gitolite:latest
ports:
- 2201
---
kind: signature
hmac: 63ea4b9d22b4a2acc4ff4978a1f78cd73079460561a4a238328b6235d8fa4dcb
...