From 110b043ca9c720167c892abc74f2daf5cef375f4 Mon Sep 17 00:00:00 2001 From: Quentin Ferrand Date: Tue, 19 Apr 2022 10:18:59 +0200 Subject: [PATCH] add drone pipeline --- .drone.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ tenkan/files.py | 2 +- 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..f96a572 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,51 @@ +--- +kind: pipeline +type: kubernetes +name: python + +steps: +- name: test + image: python:latest + commands: + - pip install -q --upgrade pre-commit + - pre-commit run --all-files +# - flake8 --ignore=E501,W503,E265 +# - mypy --ignore-missing-imports ./tenkan/ +# - pylint --disable=E1101,E0401,C0301,W1514,C0114 ./tenkan/ +# - pytest ./tests/ + +- name: publish_pypi + image: plugins/pypi + settings: + username: + from_secret: pypi_username + password: + from_secret: pypi_password + when: + branch: + - master + +- name: push_docker + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: takaoni/tenkan + tags: latest + when: + branch: + - master + +- name: deploy_kube + kube: + image: takaoni/drone-kube + template: apps/tenkan.yaml + namespace: gemini + server: + from_secret: kube_server + when: + branch: + - master + diff --git a/README.md b/README.md index e2c8125..a60fce2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://drone.fqserv.eu/api/badges/takaoni/tenkan/status.svg)](https://drone.fqserv.eu/takaoni/tenkan) + # tenkan Command line tool to convert HTTP RSS/Atom feeds to gemini format. diff --git a/tenkan/files.py b/tenkan/files.py index ab8e1e3..c4c2926 100644 --- a/tenkan/files.py +++ b/tenkan/files.py @@ -27,7 +27,7 @@ def write_files(path: str, data: dict, max_num_entries: int) -> None: num_entries = 0 # count entries in index file if pathlib.Path(f'{path}/index.gmi').is_file(): - num_entries = sum(1 for line in open(f'{path}/index.gmi')) + num_entries = sum(1 for line in open(f'{path}/index.gmi')) # pylint: disable=consider-using-with # if there is more articles than defined in max_num_entries, delete and rewrite if num_entries > max_num_entries: