Display build date in UI, injected during CI build
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<body>
|
||||
<header>
|
||||
<h1>Infrastructure Map</h1>
|
||||
<span class="subtitle">Auto-refreshes every 60s</span>
|
||||
<span class="subtitle">Auto-refreshes every 60s | Built: {{ build_date }}</span>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
|
||||
Reference in New Issue
Block a user