Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: include commit hashes in footer #188

Merged
merged 7 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "pnpm@9.10.0+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
Loading