scripts/dossiers-ngi/README.md: update branch-status-hourly.py reference
This commit is contained in:
parent
8a09314eaf
commit
e35205b6cd
3 changed files with 15 additions and 5 deletions
|
|
@ -14,10 +14,12 @@ SoT for the blank cascade landing on **dossiers.ngi.hacktivism.ch**
|
|||
| Var | Default | Meaning |
|
||||
|-----|---------|---------|
|
||||
| `TDPD_ROOT` | `$HOME/git/src/ngi/tech-dossier-project-data` | tech-dossier-project-data checkout for tip SHAs |
|
||||
| `OUT` | `sites/dossiers.ngi.hacktivism.ch/branch-status.json` under kal | write path for JSON (live www on koopa) |
|
||||
| `ADMIN_LOG` | (script derives from `__file__`) | koopa-admin-log root |
|
||||
|
||||
On koopa the clone often lives at `%h/src/koopa/koopa-admin-log`; set
|
||||
`TDPD_ROOT` in the service `Environment=` if the tdpd path differs.
|
||||
`TDPD_ROOT` and `OUT` in `~/.config/dossiers-ngi/branch-status.env` when the
|
||||
tdpd path or live www path differs from the laptop defaults.
|
||||
|
||||
## Manual run
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,14 @@ from datetime import datetime, timezone
|
|||
from pathlib import Path
|
||||
|
||||
ADMIN_LOG = Path(__file__).resolve().parents[2]
|
||||
OUT = ADMIN_LOG / "sites" / "dossiers.ngi.hacktivism.ch" / "branch-status.json"
|
||||
_DEFAULT_OUT = ADMIN_LOG / "sites" / "dossiers.ngi.hacktivism.ch" / "branch-status.json"
|
||||
HOST = "https://dossiers.ngi.hacktivism.ch"
|
||||
|
||||
|
||||
def out_path() -> Path:
|
||||
raw = os.environ.get("OUT", "").strip()
|
||||
return Path(raw).expanduser() if raw else _DEFAULT_OUT
|
||||
|
||||
# Default local clone; override with TDPD_ROOT (koopa may use a different path).
|
||||
DEFAULT_TDPD = Path.home() / "git" / "src" / "ngi" / "tech-dossier-project-data"
|
||||
|
||||
|
|
@ -76,9 +81,10 @@ def main() -> int:
|
|||
for b in branches
|
||||
],
|
||||
}
|
||||
OUT.parent.mkdir(parents=True, exist_ok=True)
|
||||
OUT.write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")
|
||||
print(f"wrote {OUT}", file=sys.stderr)
|
||||
dest = out_path()
|
||||
dest.parent.mkdir(parents=True, exist_ok=True)
|
||||
dest.write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")
|
||||
print(f"wrote {dest}", file=sys.stderr)
|
||||
return 0
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue