Skip to content

Commit

Permalink
fix: add version tag to footer
Browse files Browse the repository at this point in the history
  • Loading branch information
thilobillerbeck committed Nov 19, 2024
1 parent 4752f71 commit fee1b49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN corepack enable
COPY . /app
WORKDIR /app
RUN git rev-parse --short HEAD > .git-rev
RUN git describe --tags --abbrev=0 > .git-tag
RUN rm -rf .git

FROM base AS prod-deps
Expand Down
5 changes: 3 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ if (process.env.SENTRY_DSN) {
let version = "development"

const gitRevPath = pathJoin(__dirname, '.git-rev')
if (require('fs').existsSync(gitRevPath)) {
version = readFileSync(gitRevPath, 'utf-8').trim()
const gitTagPath = pathJoin(__dirname, '.git-tag')
if (require('fs').existsSync(gitRevPath) && require('fs').existsSync(gitTagPath)) {
version = `${readFileSync(gitTagPath, 'utf-8').toString().trim()} (${readFileSync(gitRevPath, 'utf-8').toString().trim()})`
}

app.register(fastifyCookie)
Expand Down

0 comments on commit fee1b49

Please sign in to comment.