VBV-143: "git revision hash" und Build-Datum anzeigen
This commit is contained in:
parent
3ff2b23cf7
commit
ac268907bf
|
|
@ -3,7 +3,7 @@
|
|||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc --noEmit && vite build && cp ./dist/index.html ../server/vbv_lernwelt/templates/vue/index.html && cp -r ./dist/static/vue ../server/vbv_lernwelt/static/",
|
||||
"build": "vue-tsc --noEmit && vite build && node versionize && cp ./dist/index.html ../server/vbv_lernwelt/templates/vue/index.html && cp -r ./dist/static/vue ../server/vbv_lernwelt/static/",
|
||||
"build:tailwind": "tailwindcss -i tailwind.css -o ../server/vbv_lernwelt/static/css/tailwind.css --minify",
|
||||
"test": "vitest run",
|
||||
"coverage": "vitest run --coverage",
|
||||
|
|
@ -44,6 +44,7 @@
|
|||
"postcss": "^8.4.14",
|
||||
"postcss-import": "^14.1.0",
|
||||
"prettier": "^2.7.1",
|
||||
"replace-in-file": "^6.3.5",
|
||||
"sass": "^1.54.6",
|
||||
"sass-loader": "^12.6.0",
|
||||
"start-server-and-test": "^1.14.0",
|
||||
|
|
|
|||
|
|
@ -1,21 +1,15 @@
|
|||
<script setup lang="ts">
|
||||
import * as log from 'loglevel';
|
||||
|
||||
log.debug('Footer created');
|
||||
import * as log from 'loglevel'
|
||||
|
||||
log.debug('Footer created')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<footer
|
||||
class="
|
||||
px-8
|
||||
py-4
|
||||
bg-gray-200
|
||||
border-t border-gray-500
|
||||
">
|
||||
@2022 VBV
|
||||
<footer class="px-8 py-4 bg-gray-200 border-t border-gray-500 flex">
|
||||
<div>@2022 VBV</div>
|
||||
<div class="flex-grow"></div>
|
||||
<div>VBV_VERSION_BUILD_NUMBER_VBV</div>
|
||||
</footer>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
const replace = require("replace-in-file");
|
||||
const gitHash = require('child_process')
|
||||
.execSync("git rev-parse --short HEAD")
|
||||
.toString().trim()
|
||||
|
||||
const options = {
|
||||
files: "dist/static/vue/*.js",
|
||||
from: /VBV_VERSION_BUILD_NUMBER_VBV/g,
|
||||
to: new Date().toISOString().replace("T", " ").substring(0, 19) + ' ' + gitHash,
|
||||
};
|
||||
|
||||
replace(options, (error, results) => {
|
||||
if (error) {
|
||||
return console.error("Versionize Error occurred:", error);
|
||||
}
|
||||
console.log(`Versionized ${results.filter((f) => f.hasChanged).length} files`);
|
||||
});
|
||||
Loading…
Reference in New Issue