build: alle Template-PDFs automatisch in Build und Release aufnehmen
Alle *.pdf im template-Ordner werden ausgeliefert; Dateien mit '_' oder '.' am Anfang sowie andere Dateitypen werden ignoriert. Veraltete PDFs im Build-Ordner werden entfernt. Tests entsprechend angepasst. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2237779e56
commit
7de6984ebc
4 files changed
+42
-12
No files matched your search
@@ -21,7 +21,7 @@ from datetime import date
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from deploy import deploy, write_release_manifest
|
||||
from deploy import deploy, is_template_pdf, write_release_manifest
|
||||
|
||||
# ── Pfade ───────────────────────────────────────────────────────
|
||||
BUILD_PIPELINE_DIR = Path(__file__).resolve().parent
|
||||
@@ -223,10 +223,17 @@ def _prepare_build_dir() -> None:
|
||||
shutil.copy2(f, config_dst / f.name)
|
||||
|
||||
shutil.copy2(CHANGELOG_PATH, BUILD_OUTPUT_DIR / "CHANGELOG.md")
|
||||
shutil.copy2(
|
||||
APP_DIR / "template" / "Tätigkeitsnachweise Stellenförderung.pdf",
|
||||
BUILD_OUTPUT_DIR / "template" / "Tätigkeitsnachweise Stellenförderung.pdf",
|
||||
)
|
||||
|
||||
# Alle Template-PDFs ausliefern (ohne Dateien mit '_' oder '.' am Anfang).
|
||||
# Veraltete PDFs aus früheren Builds werden entfernt.
|
||||
tpl_src = APP_DIR / "template"
|
||||
tpl_dst = BUILD_OUTPUT_DIR / "template"
|
||||
wanted = {p.name for p in tpl_src.iterdir() if is_template_pdf(p)}
|
||||
for old_pdf in tpl_dst.iterdir():
|
||||
if is_template_pdf(old_pdf) and old_pdf.name not in wanted:
|
||||
old_pdf.unlink()
|
||||
for name in sorted(wanted):
|
||||
shutil.copy2(tpl_src / name, tpl_dst / name)
|
||||
|
||||
# README für input-Ordner
|
||||
input_readme = BUILD_OUTPUT_DIR / "input" / "_DATEIEN_HIER_ABLEGEN_.txt"
|
||||
|
||||
Reference in new issue
Block a user