fix/dossiers-ngi: update README and scripts for branch status
This commit is contained in:
parent
8ad49de231
commit
197e0ab19a
3 changed files with 32 additions and 3 deletions
|
|
@ -534,15 +534,26 @@ def rebuild_edition(repo: Path, branch: str, tip: str, editions: Path) -> dict:
|
|||
shutil.rmtree(wt, ignore_errors=True)
|
||||
|
||||
|
||||
def _edition_built_at(editions: Path, slug: str) -> str:
|
||||
p = editions / slug / ".edition-built-at"
|
||||
if not p.is_file():
|
||||
return ""
|
||||
return p.read_text(encoding="utf-8").strip()
|
||||
|
||||
|
||||
def sync_flask_alias(editions: Path, tips: dict[str, str]) -> None:
|
||||
"""Keep editions/flask in sync with DEFAULT_BRANCH freeze when present."""
|
||||
src_branch = default_branch()
|
||||
if src_branch not in tips:
|
||||
return
|
||||
src = editions / edition_slug(src_branch)
|
||||
src_slug = edition_slug(src_branch)
|
||||
src = editions / src_slug
|
||||
dst = editions / "flask"
|
||||
tip = tips[src_branch]
|
||||
if tip_recorded(editions, "flask") == tip and (dst / "index.html").is_file():
|
||||
flask_ok, _ = freeze_ok_for(editions, "flask", tip)
|
||||
src_built = _edition_built_at(editions, src_slug)
|
||||
flask_built = _edition_built_at(editions, "flask")
|
||||
if flask_ok and src_built and src_built == flask_built:
|
||||
return
|
||||
if not (src / "index.html").is_file():
|
||||
ensure_placeholder(editions, "flask", tip)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue