Use version from environment
This commit is contained in:
parent
0010e07b47
commit
961913b88a
|
@ -49,7 +49,6 @@ function httpLogging() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPackageJsonFields(): {
|
function getPackageJsonFields(): {
|
||||||
VERSION: string
|
|
||||||
SERVICE_NAME: string
|
SERVICE_NAME: string
|
||||||
} {
|
} {
|
||||||
function findFileInAncestors(
|
function findFileInAncestors(
|
||||||
|
@ -75,12 +74,11 @@ function getPackageJsonFields(): {
|
||||||
const content = readFileSync(packageJsonFile!, "utf-8")
|
const content = readFileSync(packageJsonFile!, "utf-8")
|
||||||
const parsedContent = JSON.parse(content)
|
const parsedContent = JSON.parse(content)
|
||||||
return {
|
return {
|
||||||
VERSION: parsedContent.version,
|
|
||||||
SERVICE_NAME: parsedContent.name,
|
SERVICE_NAME: parsedContent.name,
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// throwing an error here is confusing/causes backend-core to be hard to import
|
// throwing an error here is confusing/causes backend-core to be hard to import
|
||||||
return { VERSION: "", SERVICE_NAME: "" }
|
return { SERVICE_NAME: "" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,6 +171,7 @@ const environment = {
|
||||||
ENABLE_SSO_MAINTENANCE_MODE: selfHosted
|
ENABLE_SSO_MAINTENANCE_MODE: selfHosted
|
||||||
? process.env.ENABLE_SSO_MAINTENANCE_MODE
|
? process.env.ENABLE_SSO_MAINTENANCE_MODE
|
||||||
: false,
|
: false,
|
||||||
|
VERSION: process.env.VERSION!,
|
||||||
...getPackageJsonFields(),
|
...getPackageJsonFields(),
|
||||||
DISABLE_PINO_LOGGER: process.env.DISABLE_PINO_LOGGER,
|
DISABLE_PINO_LOGGER: process.env.DISABLE_PINO_LOGGER,
|
||||||
OFFLINE_MODE: process.env.OFFLINE_MODE,
|
OFFLINE_MODE: process.env.OFFLINE_MODE,
|
||||||
|
|
Loading…
Reference in New Issue