bump version and retry drone full deply
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
b4dfce2ed9
commit
337abc3db1
3 changed files with 22 additions and 31 deletions
31
.drone.yml
31
.drone.yml
|
@ -33,24 +33,23 @@ steps:
|
||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
repo: takaoni/tenkan
|
repo: takaoni/tenkan
|
||||||
tags: '1.3'
|
tags: ${'DRONE_COMMIT_SHA':0:8}
|
||||||
dockerfile: docker/Dockerfile
|
dockerfile: docker/Dockerfile
|
||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
# - name: deploy_kube
|
- name: deploy_kube
|
||||||
# image: takaoni/drone-kube
|
image: sinlead/drone-kubectl
|
||||||
# settings:
|
settings:
|
||||||
# template: apps/tenkan.yaml
|
kubernetes_server:
|
||||||
# namespace: gemini
|
from_secret: kube_url
|
||||||
# server:
|
kubernetes_cert:
|
||||||
# from_secret: kube_server
|
from_secret: kube_cert
|
||||||
# when:
|
kubernetes_token:
|
||||||
# branch:
|
from_secret: kube_token
|
||||||
# - master
|
commands:
|
||||||
|
- kubectl set image deployment/tenkan fqserv=takaoni/tenkan:${'DRONE_COMMIT_SHA':0:8} -n gemini
|
||||||
host_aliases:
|
when:
|
||||||
- ip: 192.168.0.210
|
branch:
|
||||||
hostnames:
|
- master
|
||||||
- git.fqserv.eu
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -19,7 +19,7 @@ here = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='tenkan',
|
name='tenkan',
|
||||||
version='0.1.5',
|
version='0.1.6',
|
||||||
description='RSS/atom feed converter from html to gemini',
|
description='RSS/atom feed converter from html to gemini',
|
||||||
python_requires='==3.*,>=3.8.0',
|
python_requires='==3.*,>=3.8.0',
|
||||||
project_urls={'repository': 'https://git.fqserv.eu/takaoni/tenkan'},
|
project_urls={'repository': 'https://git.fqserv.eu/takaoni/tenkan'},
|
||||||
|
|
|
@ -62,9 +62,7 @@ def delete_folder(path: str, feed_name: str) -> None:
|
||||||
shutil.rmtree(f'{path}{feed_name}')
|
shutil.rmtree(f'{path}{feed_name}')
|
||||||
logging.info('%s/%s folder deleted', path, feed_name)
|
logging.info('%s/%s folder deleted', path, feed_name)
|
||||||
else:
|
else:
|
||||||
logging.info(
|
logging.info('folder %s%s not present, nothing to delete', path, feed_name)
|
||||||
'folder %s%s not present, nothing to delete', path, feed_name
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def index_file_write_header(path: str, title: str) -> None:
|
def index_file_write_header(path: str, title: str) -> None:
|
||||||
|
@ -80,9 +78,7 @@ def index_file_write_footer(path: str) -> None:
|
||||||
index.write('\n=> atom.xml Atom feed\n')
|
index.write('\n=> atom.xml Atom feed\n')
|
||||||
|
|
||||||
|
|
||||||
def write_article(
|
def write_article(article: dict, data: dict, path: str) -> Dict[str, Union[bool, str]]:
|
||||||
article: dict, data: dict, path: str
|
|
||||||
) -> Dict[str, Union[bool, str]]:
|
|
||||||
"""Write individual article"""
|
"""Write individual article"""
|
||||||
# prepare data for file format
|
# prepare data for file format
|
||||||
date = article['article_date']
|
date = article['article_date']
|
||||||
|
@ -93,9 +89,7 @@ def write_article(
|
||||||
|
|
||||||
# we add the entry into index file
|
# we add the entry into index file
|
||||||
with open(f'{path}/index.gmi', 'a') as index:
|
with open(f'{path}/index.gmi', 'a') as index:
|
||||||
index.write(
|
index.write(f"=> {file_date}_{file_title}.gmi {date} - {article['article_title']}\n")
|
||||||
f"=> {file_date}_{file_title}.gmi {date} - {article['article_title']}\n"
|
|
||||||
)
|
|
||||||
|
|
||||||
new_file = False
|
new_file = False
|
||||||
# write the file is it doesn't exist, obviously
|
# write the file is it doesn't exist, obviously
|
||||||
|
@ -105,9 +99,7 @@ def write_article(
|
||||||
# we write the entry file
|
# we write the entry file
|
||||||
author = article['author'] if 'author' in article else None
|
author = article['author'] if 'author' in article else None
|
||||||
|
|
||||||
pathlib.Path(f'{path}/{file_date}_{file_title}.gmi').write_text(
|
pathlib.Path(f'{path}/{file_date}_{file_title}.gmi').write_text(f"# {article['article_title']}\n\n=> {article['http_url']}\n\n{date}, {author}\n\n{content}")
|
||||||
f"# {article['article_title']}\n\n=> {article['http_url']}\n\n{date}, {author}\n\n{content}"
|
|
||||||
)
|
|
||||||
url = f"{data['gmi_url']}{data['title']}/{file_date}_{file_title}.gmi"
|
url = f"{data['gmi_url']}{data['title']}/{file_date}_{file_title}.gmi"
|
||||||
return {'new_file': new_file, 'url': url}
|
return {'new_file': new_file, 'url': url}
|
||||||
|
|
||||||
|
@ -123,9 +115,9 @@ def _rebuild_atom_file(path: str, data: dict, urls: list) -> None:
|
||||||
atomfeed.link(href=data['gmi_url'], rel='alternate')
|
atomfeed.link(href=data['gmi_url'], rel='alternate')
|
||||||
|
|
||||||
# rebuild all articles
|
# rebuild all articles
|
||||||
for article in enumerate(data['articles']):
|
for art, article in enumerate(data['articles']):
|
||||||
atomentry = atomfeed.add_entry()
|
atomentry = atomfeed.add_entry()
|
||||||
url = urls[0]
|
url = urls[art]
|
||||||
atomentry.guid(url)
|
atomentry.guid(url)
|
||||||
atomentry.link(href=url, rel='alternate')
|
atomentry.link(href=url, rel='alternate')
|
||||||
atomentry.updated(article['updated'])
|
atomentry.updated(article['updated'])
|
||||||
|
|
Loading…
Reference in a new issue