Compare commits

...

2 Commits

Author SHA1 Message Date
Histausse fc90b3fb71 Add CI config 2023-05-19 19:35:45 +02:00
Histausse 6aa251e9ec add badge 2023-05-19 18:32:16 +02:00
5 changed files with 30 additions and 6 deletions

View File

@ -1,5 +1,4 @@
# TODO:
- add CI
- add flake
- use bool value for `generate_gitea_project` when the feature is available

View File

@ -5,12 +5,12 @@
"email": "",
"git_user": "",
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}",
"gitea_url": "",
"gitea_url": "https://git.pains-perdus.fr",
"project_url": "{{ cookiecutter.gitea_url }}/{{ cookiecutter.git_user }}/{{ cookiecutter.project_slug }}",
"generate_gitea_project": [ true, false ],
"configure_ci": [ true, false ],
"woodpecker_gitea_user": "ci",
"woodpecker_server": "ci.pains-perdus.fr",
"woodpecker_server": "https://ci.pains-perdus.fr",
"git_origin": "{{ cookiecutter.gitea_url.replace('https://', 'gitea@').replace('http://', 'gitea') }}:{{ cookiecutter.git_user }}/{{ cookiecutter.project_slug }}.git",
"version": "0.1.0",
"open_source_license": ["AGPL-3.0-only", "GPL-3.0-only", "MIT", "BSD-3-Clause", "ISC", "Apache-2.0", "Proprietary"],

View File

@ -1,4 +1,17 @@
import subprocess
import os
REMOVE_PATHS = [
{% if cookiecutter.open_source_license == "Proprietary" %} "LICENSE", {% endif %}
{% if cookiecutter.configure_ci == "False" %} ".woodpecker.yml", {% endif %}
]
for path in REMOVE_PATHS:
if path and os.path.exists(path):
if os.path.isdir(path):
os.rmdir(path)
else:
os.unlink(path)
subprocess.call(["git", "init"])
subprocess.call(["git", "checkout", "-b", "main"])

View File

@ -1,5 +1,14 @@
pipeline:
a-test-step:
image: debian
test:
image: python:${PYTHON_VERSION}
pull: true
environment:
- POETRY_VIRTUALENVS_IN_PROJECT=true
commands:
- echo "Testing.."
- pip install poetry
- poetry install
- poetry run pytest
matrix:
PYTHON_VERSION:
- {{ cookiecutter. python_min_version}}

View File

@ -1,5 +1,8 @@
{% set is_open_source = cookiecutter.open_source_license != 'Proprietary' -%}
{% set repo = "/".join(cookiecutter.git_origin.removesuffix(".git").split(":")[-1].split("/")[-2:]) %}
# {{ cookiecutter.project_name }}
{% if cookiecutter.configure_ci %}[![CI status badge]({{ cookiecutter.woodpecker_server }}/api/badges/{{ repo }}/status.svg)](https://ci.pains-perdus.fr/histausse/test_ci_template){% endif %}
{{ cookiecutter.project_short_description }}