From 95d1568092682409aaf2ad1a59a3bc344dcd2cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Witkowski?= Date: Tue, 30 Jul 2024 20:48:55 +0200 Subject: [PATCH] UI: display git hash and build timestamp in the footer --- frontend/package-lock.json | 38 +++++++++++++++++++++++++++++++++++++- frontend/package.json | 3 ++- frontend/src/App.vue | 3 +++ frontend/vue.config.js | 1 + 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 8235e6c..66f145f 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -24,7 +24,8 @@ "webpack": "^5.93.0" }, "devDependencies": { - "@vue/cli-service": "^5.0.8" + "@vue/cli-service": "^5.0.8", + "git-describe": "^4.1.1" } }, "node_modules/@achrinza/node-ipc": { @@ -694,6 +695,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/send": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", @@ -4144,6 +4152,34 @@ "node": ">=6" } }, + "node_modules/git-describe": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-describe/-/git-describe-4.1.1.tgz", + "integrity": "sha512-JC8ganO5kO80G8+XE98TDDjnMXQN3Estk3qdJuG2EGRF/l6zuMTMcN+8OSfQZ5FWpqIRLB015anWX4aSRgnxAQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/semver": "^7.3.8", + "lodash": "^4.17.21" + }, + "engines": { + "node": ">=4.0.0" + }, + "optionalDependencies": { + "semver": "^5.6.0" + } + }, + "node_modules/git-describe/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", diff --git a/frontend/package.json b/frontend/package.json index 0328e09..655310a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -23,7 +23,8 @@ "webpack": "^5.93.0" }, "devDependencies": { - "@vue/cli-service": "^5.0.8" + "@vue/cli-service": "^5.0.8", + "git-describe": "^4.1.1" }, "browserslist": [ "> 1%", diff --git a/frontend/src/App.vue b/frontend/src/App.vue index d7b2b63..420b81a 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -27,11 +27,13 @@ +
+ @@ -237,6 +239,7 @@ export default { return { options: [], selected: '', + buildInfo: 'Build: v.' + process.env.VUE_APP_GIT_HASH + ", " + process.env.VUE_APP_BUILD_TIMESTAMP }; }, diff --git a/frontend/vue.config.js b/frontend/vue.config.js index 1c6e7d0..1503fd8 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -2,6 +2,7 @@ const { defineConfig } = require('@vue/cli-service') const {gitDescribe, gitDescribeSync} = require('git-describe'); process.env.VUE_APP_GIT_HASH = gitDescribeSync().hash +process.env.VUE_APP_BUILD_TIMESTAMP = new Date().toISOString() module.exports = defineConfig({ devServer: {