From c9dd60027f679abff4c9730882c6b7ad11d3e552 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 25 Apr 2021 15:48:33 -0400 Subject: [PATCH] Add UI version to UI via docker. Fixes #263 --- Dockerfile | 4 ++++ src/shared/components/footer.tsx | 6 +++++- src/shared/components/main.tsx | 4 +++- src/shared/components/navbar.tsx | 5 ++++- src/shared/version.ts | 1 + 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 src/shared/version.ts diff --git a/Dockerfile b/Dockerfile index c03cdc6d..a56a391b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,10 @@ COPY generate_translations.js \ COPY lemmy-translations lemmy-translations COPY src src +COPY .git .git + +# Set UI version +RUN echo "export const VERSION = '$(git describe --tag)';" > "src/shared/version.ts" RUN yarn RUN yarn build:prod diff --git a/src/shared/components/footer.tsx b/src/shared/components/footer.tsx index 16f5fc76..f688bb62 100644 --- a/src/shared/components/footer.tsx +++ b/src/shared/components/footer.tsx @@ -3,6 +3,7 @@ import { Link } from "inferno-router"; import { i18n } from "../i18next"; import { repoUrl, joinLemmyUrl, docsUrl } from "../utils"; import { GetSiteResponse } from "lemmy-js-client"; +import { VERSION } from "../version"; interface FooterProps { site: GetSiteResponse; @@ -19,7 +20,10 @@ export class Footer extends Component {