mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-11-23 14:09:51 +00:00
ci(dockerfile): fix missing commit hash (#2134)
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
db9542da53
commit
b0a6250dc1
@ -20,13 +20,16 @@ import { browserslistToTargets } from 'lightningcss';
|
||||
import virtualModules from './scripts/virtual-modules';
|
||||
import { localeFilesFolder, srcRoot } from './scripts/paths';
|
||||
|
||||
const is_stable = !Number(process.env.IS_STABLE);
|
||||
const commit_hash = is_stable && process.env.COMMIT_HASH;
|
||||
|
||||
export default defineConfig(({ mode }): UserConfig => {
|
||||
const config: UserConfig = {
|
||||
appType: 'spa',
|
||||
base: './',
|
||||
cacheDir: '../node_modules/.cache/vite',
|
||||
define: {
|
||||
__COMMIT_HASH__: JSON.stringify(process.env.COMMIT_HASH || '')
|
||||
...(commit_hash && { __COMMIT_HASH__: JSON.stringify(commit_hash)})
|
||||
},
|
||||
plugins: [
|
||||
virtual(virtualModules),
|
||||
|
@ -1,6 +1,7 @@
|
||||
## This dockerfile builds the client entirely in a Docker context
|
||||
|
||||
FROM node:20-slim AS build
|
||||
# slim image can't be used since we need git to fetch the commit hash
|
||||
FROM node:20 AS build
|
||||
|
||||
# Set build arguments
|
||||
ARG DEFAULT_SERVERS
|
||||
@ -21,7 +22,7 @@ WORKDIR /app/frontend
|
||||
RUN npm ci --no-audit --ignore-scripts
|
||||
|
||||
# Build client
|
||||
RUN if [ $"IS_STABLE" = "0" ] ; then export COMMIT_HASH=$(git rev-parse HEAD) ; fi && npm run build
|
||||
RUN COMMIT_HASH=$(git rev-parse HEAD) npm run build
|
||||
|
||||
# Deploy built distribution to nginx
|
||||
FROM nginx:stable-alpine-slim
|
||||
|
Loading…
Reference in New Issue
Block a user