Skip to content

Commit

Permalink
feat: include commit hashes in footer (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
simar0at authored Nov 11, 2024
2 parents 3bdf226 + 4ec52e6 commit 341870c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ dist

## .dockerignore ##

# git
.git/
.gitignore

# github
.github/

Expand Down
17 changes: 16 additions & 1 deletion components/app-footer.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<script setup lang="ts"></script>
<script setup lang="ts">
const env = useRuntimeConfig();
const { data: config } = useProjectInfo();
</script>

<template>
<footer
Expand All @@ -18,6 +21,18 @@
</span>
<span>|</span>
<NuxtLink class="hover:underline hover:underline-offset-2" href="/imprint">Imprint</NuxtLink>
<span>|</span>
<span class="flex gap-1">
<span>Frontend: {{ env.public.currentGitSha }}</span>
</span>
<span>|</span>
<span class="flex gap-1">
<span>Backend: {{ config?.projectConfig?.version?.backend }}</span>
</span>
<span>|</span>
<span class="flex gap-1">
<span>Data: {{ config?.projectConfig?.version?.data }}</span>
</span>
<div
class="h-4 flex-1"
onmouseover="document.querySelector('footer').classList.add('-translate-y-80')"
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default defineNuxtConfig({
teiBaseurl: process.env.NUXT_PUBLIC_TEI_BASEURL,
apiUser: process.env.NUXT_PUBLIC_API_USER,
apiPass: process.env.NUXT_PUBLIC_API_PASS,
currentGitSha: process.env.NUXT_PUBLIC_CURRENT_GIT_SHA,
},
},

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"packageManager": "[email protected]+sha256.355a8ab8dbb6ad41befbef39bc4fd6b5df85e12761d2724bd01f13e878de4b13",
"scripts": {
"analyze": "nuxt analyze",
"build": "run-s generate:api-client build:client",
"build": "NUXT_PUBLIC_CURRENT_GIT_SHA=$(git describe --tags --always) && run-s generate:api-client build:client",
"build:client": "nuxt build --dotenv ./.env.local",
"dev": "nuxt dev --dotenv ./.env.local --host 127.0.0.1 --no-fork",
"dev": "NUXT_PUBLIC_CURRENT_GIT_SHA=$(git describe --tags --always) && nuxt dev --dotenv ./.env.local --host 127.0.0.1 --no-fork",
"format:check": "prettier . --cache --check --ignore-path ./.gitignore",
"format:fix": "pnpm run format:check --write",
"generate:api-client": "swagger-typescript-api --path \"https://raw.githubusercontent.com/acdh-oeaw/vicav-app-api/master/openapi.json\" --clean-output --name index.ts --output ./lib/api-client/",
Expand All @@ -27,7 +27,7 @@
"prepare": "run-s setup generate:api-client",
"setup": "is-ci || simple-git-hooks",
"start:preview": "nuxt preview --dotenv ./.env.local",
"start": "node .output/server/index.mjs",
"start": "NUXT_PUBLIC_CURRENT_GIT_SHA=$(git rev-parse HEAD) && node .output/server/index.mjs",
"start:local": "dotenv -e .env.local -- pnpm run start",
"test": "dotenv -e .env.local -- node checkenv.mjs && pnpm playwright install && pnpm validate",
"test:e2e": "playwright test",
Expand Down

0 comments on commit 341870c

Please sign in to comment.