Include git version information in webpage and /etc/rpi-issue (#110)

Fixes #95.
This commit is contained in:
Peter Johnson
2019-02-18 01:22:58 -08:00
committed by GitHub
parent 3f1dc37384
commit 3f9cbe8b41
6 changed files with 26 additions and 6 deletions
+4 -3
View File
@@ -1,3 +1,4 @@
IMG_VERSION?=$(shell git describe)
DEPS_CFLAGS?=$(shell pkg-config --cflags cscore wpiutil)
DEPS_LIBS?=$(shell pkg-config --libs --static cscore wpiutil)
EXEC_HOME?=/home/pi
@@ -44,11 +45,11 @@ configServer: ${OBJS}
$<
%.html.cpp: %.html
./gen_resource.py $@ $<
env IMG_VERSION=${IMG_VERSION} ./gen_resource.py $@ $<
%.css.cpp: %.css
./gen_resource.py $@ $<
env IMG_VERSION=${IMG_VERSION} ./gen_resource.py $@ $<
%.js.cpp: %.js
./gen_resource.py $@ $<
env IMG_VERSION=${IMG_VERSION} ./gen_resource.py $@ $<
+4
View File
@@ -15,6 +15,10 @@ args = parser.parse_args()
with open(args.inputFile, "rb") as f:
data = f.read()
version = os.getenv('IMG_VERSION')
if version is not None and b'IMG_VERSION' in data:
data = data.replace(b'IMG_VERSION', version.encode('utf-8'))
fileSize = len(data)
inputBase = os.path.basename(args.inputFile)
+9
View File
@@ -474,6 +474,15 @@
</div>
</main>
</div>
<footer class="app-footer">
<div>
<a href="http://wpilib.screenstepslive.com/s/currentCS/m/85074/l/1027798-the-raspberry-pi-frc-console" target="_new">FRCVision-rPi</a>
<span>&copy; 2019 FIRST</span>
</div>
<div class="ml-auto">
<a href="https://github.com/wpilibsuite/FRCVision-pi-gen/releases" target="_new">IMG_VERSION</a>
</div>
</footer>
<script type="text/javascript" src="jquery-3.3.1.slim.min.js"></script>
<script type="text/javascript" src="popper.min.js"></script>