You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
125 lines
3.6 KiB
125 lines
3.6 KiB
cd /home/def/otb_billing || exit 1 |
|
set -e |
|
|
|
STAMP="$(date +%Y%m%d-%H%M%S)" |
|
NEW_VERSION="v0.6.0" |
|
ZIP_NAME="otb_billing-${NEW_VERSION}.zip" |
|
|
|
echo "===== backups =====" |
|
cp VERSION "VERSION.bak.${STAMP}" |
|
cp README.md "README.md.bak.${STAMP}" |
|
cp PROJECT_STATE.md "PROJECT_STATE.md.bak.${STAMP}" |
|
|
|
echo "===== version bump =====" |
|
printf '%s\n' "${NEW_VERSION}" > VERSION |
|
|
|
echo "===== update README + PROJECT_STATE =====" |
|
python3 <<'PY' |
|
from pathlib import Path |
|
from datetime import datetime, timezone |
|
|
|
root = Path("/home/def/otb_billing") |
|
version = "v0.6.0" |
|
stamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") |
|
utc_stamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC") |
|
|
|
readme = root / "README.md" |
|
project_state = root / "PROJECT_STATE.md" |
|
|
|
readme_text = readme.read_text() if readme.exists() else "" |
|
project_text = project_state.read_text() if project_state.exists() else "" |
|
|
|
readme_entry = """## v0.6.0 - {stamp} |
|
|
|
### Highlights |
|
- Added authenticated /portal/services page as a service hub |
|
- Introduced modular route backend/routes/portal_services.py |
|
- Created shared templates/portal_base.html layout |
|
- Converted portal pages to base-template architecture |
|
- Added service cards (Follow-me, Video, Miner Rentals) |
|
- Fixed branding, nav, footer, and toggle consistency |
|
- Corrected Follow-me external link |
|
- External services now open in new tabs |
|
- Improved identity display for logged-in user |
|
|
|
### Notes |
|
- portal_base.html is now the standard structure for future pages and projects |
|
- Billing portal is now the launch point for all OTB services |
|
|
|
""".replace("{stamp}", stamp) |
|
|
|
project_entry = """# Project State Update - v0.6.0 |
|
Updated: {utc_stamp} |
|
|
|
## Current Version |
|
v0.6.0 |
|
|
|
## Current Status |
|
OTB Billing is now a service-launch platform, not just billing. |
|
|
|
## Completed This Session |
|
- Added /portal/services page |
|
- Added portal_services.py route module |
|
- Created portal_base.html shared template |
|
- Converted dashboard + services page to shared layout |
|
- Restored consistent branding, nav, footer, toggle |
|
- Added service cards (Follow-me, Video, Miner) |
|
- Fixed external service routing |
|
- Enabled new-tab launch for services |
|
|
|
## Architecture |
|
Using shared base template: |
|
templates/portal_base.html |
|
|
|
All pages now: |
|
{% extends "portal_base.html" %} |
|
|
|
## Next Steps |
|
- Unify client identity across all routes |
|
- Add Follow-me provisioning + billing linkage |
|
- Move inline CSS into shared styles later |
|
|
|
""".replace("{utc_stamp}", utc_stamp) |
|
|
|
def prepend(existing, new_block, marker): |
|
if marker in existing: |
|
return existing |
|
if existing.startswith("# "): |
|
return existing.rstrip() + "\n\n" + new_block |
|
return new_block + existing |
|
|
|
readme.write_text(prepend(readme_text, readme_entry, "## v0.6.0")) |
|
project_state.write_text(prepend(project_text, project_entry, "# Project State Update - v0.6.0")) |
|
PY |
|
|
|
echo "===== build full zip snapshot =====" |
|
rm -f "releases/${ZIP_NAME}" |
|
mkdir -p releases |
|
|
|
python3 <<'PY' |
|
from pathlib import Path |
|
import zipfile |
|
|
|
root = Path("/home/def/otb_billing") |
|
zip_path = root / "releases" / "otb_billing-v0.6.0.zip" |
|
|
|
exclude_parts = {".git", "__pycache__", ".pytest_cache"} |
|
exclude_suffixes = {".pyc", ".pyo"} |
|
|
|
with zipfile.ZipFile(zip_path, "w", compression=zipfile.ZIP_DEFLATED) as zf: |
|
for path in root.rglob("*"): |
|
rel = path.relative_to(root) |
|
if any(part in exclude_parts for part in rel.parts): |
|
continue |
|
if path.suffix in exclude_suffixes: |
|
continue |
|
if path == zip_path: |
|
continue |
|
zf.write(path, arcname=str(Path("otb_billing-v0.6.0") / rel)) |
|
|
|
print(zip_path) |
|
PY |
|
|
|
echo "===== verify =====" |
|
cat VERSION |
|
ls -lh "releases/${ZIP_NAME}"
|
|
|