RED-6686 version fix

This commit is contained in:
Timo Bejan 2023-06-27 01:53:59 +03:00
parent bc291c5db0
commit 356ce4f1e0
5 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,7 @@
{
"ADMIN_CONTACT_NAME": null,
"ADMIN_CONTACT_URL": null,
"API_URL": "https://dev-01.iqser.cloud",
"API_URL": "https://dev-02.iqser.cloud",
"APP_NAME": "RedactManager",
"AUTO_READ_TIME": 3,
"BACKEND_APP_VERSION": "4.4.40",
@ -11,7 +11,7 @@
"MAX_RETRIES_ON_SERVER_ERROR": 3,
"OAUTH_CLIENT_ID": "redaction",
"OAUTH_IDP_HINT": null,
"OAUTH_URL": "https://dev-01.iqser.cloud/auth",
"OAUTH_URL": "https://dev-02.iqser.cloud/auth",
"RECENT_PERIOD_IN_HOURS": 24,
"SELECTION_MODE": "structural",
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview",

View File

@ -10,9 +10,8 @@ if (environment.production) {
}
// https://github.com/angular/angular/issues/11195#issuecomment-248020928
async function bootstrap(appConfig: AppConfig) {
const packageJson = await import('version.json');
const config = { ...appConfig, FRONTEND_APP_VERSION: packageJson.FRONTEND_APP_VERSION };
async function bootstrap(appConfig: AppConfig, version: { FRONTEND_APP_VERSION: string }) {
const config = { ...appConfig, FRONTEND_APP_VERSION: version.FRONTEND_APP_VERSION };
console.log('Started with local config: ', config);
const appModule = appModuleFactory(config);
@ -28,5 +27,8 @@ async function bootstrap(appConfig: AppConfig) {
}
const configPromise = fetch('/ui/assets/config/config.json').then(resp => resp.json());
const versionPromise = fetch('/ui/assets/config/version.json').then(resp => resp.json());
configPromise.then(bootstrap).catch(console.error);
Promise.all([configPromise, versionPromise])
.then(([appConfig, version]) => bootstrap(appConfig, version))
.catch(console.error);

View File

@ -1,8 +1,6 @@
FROM node:18.12-buster as prep
RUN apt-get update && apt-get install -y jq
COPY version.json version.json
RUN cat version.json
COPY package.json /tmp
RUN jq '{ dependencies, devDependencies, peerDependencies, scripts: (.scripts | { postinstall }) }' < /tmp/package.json > /tmp/deps.json
@ -58,6 +56,7 @@ RUN rm -rf /usr/share/nginx/html/*
## From builder stage copy over the artifacts in dist folder to default nginx public folder
COPY --from=builder /ng-app/dist/apps/red-ui /usr/share/nginx/html/ui
COPY version.json /usr/share/nginx/html/ui/assets/config/version.json
RUN chmod o+r -R /usr/share/nginx/html
RUN chmod g+r -R /usr/share/nginx/html

View File

@ -1 +0,0 @@
APP_VERSION=4.102.0