mirror of
https://github.com/sct/overseerr.git
synced 2025-09-30 15:40:40 +02:00
build: write commit tag to json file inside docker image
This commit is contained in:
@@ -28,6 +28,8 @@ COPY --from=BUILD_IMAGE /app/dist ./dist
|
||||
COPY --from=BUILD_IMAGE /app/.next ./.next
|
||||
COPY --from=BUILD_IMAGE /app/node_modules ./node_modules
|
||||
|
||||
RUN echo "{\"commitTag\": \"${COMMIT_TAG}\"}" > committag.json
|
||||
|
||||
CMD yarn start
|
||||
|
||||
EXPOSE 5055
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { Router } from 'express';
|
||||
import path from 'path';
|
||||
import user from './user';
|
||||
import authRoutes from './auth';
|
||||
import { checkUser, isAuthenticated } from '../middleware/auth';
|
||||
@@ -14,6 +15,17 @@ import mediaRoutes from './media';
|
||||
import personRoutes from './person';
|
||||
import collectionRoutes from './collection';
|
||||
import { getAppVersion } from '../utils/appVersion';
|
||||
import { existsSync } from 'fs';
|
||||
import logger from '../logger';
|
||||
|
||||
const COMMIT_TAG_PATH = path.join(__dirname, '../../committag.json');
|
||||
let commitTag = 'local';
|
||||
|
||||
if (existsSync(COMMIT_TAG_PATH)) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
commitTag = require(COMMIT_TAG_PATH).commitTag;
|
||||
logger.info(`Commit Tag: ${commitTag}`);
|
||||
}
|
||||
|
||||
const router = Router();
|
||||
|
||||
@@ -22,7 +34,7 @@ router.use(checkUser);
|
||||
router.get('/status', (req, res) => {
|
||||
return res.status(200).json({
|
||||
version: getAppVersion(),
|
||||
commitTag: process.env.COMMIT_TAG || 'local',
|
||||
commitTag,
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user