diff --git a/.gitea/workflows/build-publish.yaml b/.gitea/workflows/build-publish.yaml index 7c216d8..4023334 100644 --- a/.gitea/workflows/build-publish.yaml +++ b/.gitea/workflows/build-publish.yaml @@ -33,6 +33,8 @@ jobs: - name: Build run: | ARCH=$(uname -m) + BUILD_DATE=$(TZ=Pacific/Auckland date +"%Y-%m-%d %H:%M %Z") + sed -i "s|__BUILD_DATE__|${BUILD_DATE}|g" ./app/app.py docker build --provenance=false -t gitea.jde.nz/public/infmap:latest-${ARCH} ./app - name: Publish diff --git a/app/app.py b/app/app.py index dda5432..a084cb3 100644 --- a/app/app.py +++ b/app/app.py @@ -8,6 +8,8 @@ from concurrent.futures import ThreadPoolExecutor, as_completed import paramiko +BUILD_DATE = '__BUILD_DATE__' + from flask import Flask, render_template, jsonify from flask_sqlalchemy import SQLAlchemy @@ -272,7 +274,7 @@ def index(): for g in groups: groups[g].sort(key=lambda s: _ip_sort_key(s.primary_ip)) - return render_template('index.html', groups=groups) + return render_template('index.html', groups=groups, build_date=BUILD_DATE) @app.route('/api/servers') diff --git a/app/templates/index.html b/app/templates/index.html index 46e13ee..c291900 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -10,7 +10,7 @@

Infrastructure Map

- Auto-refreshes every 60s + Auto-refreshes every 60s | Built: {{ build_date }}