Skip to content

Commit 52b2a56

Browse files
committed
Render version of Perfdash on UI
1 parent 99464a8 commit 52b2a56

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

perfdash/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
all: push
22

33
# See deployment.yaml for the version currently running-- bump this ahead before rebuilding!
4+
# Additionally please ensure to update the same in www/VERSION
45
TAG?=2.56
6+
WWW_VERSION=$(shell cat www/VERSION)
57

68
REPO?=gcr.io/k8s-staging-perf-tests
79

@@ -24,7 +26,11 @@ run: perfdash
2426
# Use buildkit to have "COPY --chmod=" support (availability of it in "regular" docker build depends on docker version).
2527
.PHONY: container
2628
container:
29+
ifneq ($(TAG),$(WWW_VERSION))
30+
$(error Version mismatch! Makefile=$(TAG), www/VERSION=$(WWW_VERSION). Please align before building)
31+
else
2732
DOCKER_BUILDKIT=1 docker build --pull -t $(REPO)/perfdash:$(TAG) .
33+
endif
2834

2935
.PHONY: push
3036
push: container

perfdash/www/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.56

perfdash/www/index.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,15 @@ <h1 class="md-display-2">Performance Dashboard</h1>
5454
</canvas>
5555
<p style="text-align: center">Runs over time</p>
5656
</div>
57-
<p style="font-size: x-small; font-style: italic">
58-
Click a data point to see build logs. CTRL+click anywhere to trim outliers.
57+
<p style="font-size: x-small; font-style: italic; display: flex; justify-content: space-between;">
58+
<span>Click a data point to see build logs. CTRL+click anywhere to trim outliers.</span>
59+
<span>Version: <span id="version"></span></span>
5960
</p>
61+
<script>
62+
fetch('VERSION')
63+
.then(resp => resp.text())
64+
.then(version => document.getElementById('version').innerText = version)
65+
</script>
6066
<!-- Angular Material Dependencies -->
6167
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
6268
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script>

0 commit comments

Comments
 (0)