diff --git a/Dockerfile b/Dockerfile index 479ca40..1c801ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,9 @@ COPY . . RUN mise trust COPY --from=go-build /build/app/hp_ssh.wasm /build/app/hp_ssh.wasm COPY --from=go-build /build/app/wasm_exec.js /build/app/wasm_exec.js -RUN pnpm run build + +ARG IMAGE_TAG +RUN IMAGE_TAG=$IMAGE_TAG pnpm run build RUN mkdir -p /var/lib/headplane/agent FROM gcr.io/distroless/nodejs22-debian12:nonroot AS final diff --git a/vite.config.ts b/vite.config.ts index d10ecb5..48e4f03 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -13,6 +13,7 @@ if (prefix.endsWith('/')) { // Load the version via package.json const pkg = await readFile('package.json', 'utf-8'); +const isNext = process.env.IMAGE_TAG?.includes('next'); const { version } = JSON.parse(pkg); if (!version) { throw new Error('Unable to read version from package.json'); @@ -42,7 +43,7 @@ export default defineConfig(({ isSsrBuild }) => ({ include: ['@libsql/client'], }, define: { - __VERSION__: JSON.stringify(version), + __VERSION__: JSON.stringify(isNext ? `${version}-next` : version), __PREFIX__: JSON.stringify(prefix), }, }));