From 9ad47a8f61daf15e634787c9102dadc28b9c42e0 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 27 Jun 2023 01:21:42 +0300 Subject: [PATCH] RED-6686 version fix --- .git-version.json | 3 --- apps/red-ui/src/main.ts | 4 ++-- docker/red-ui/Dockerfile | 3 +-- git-version.json | 10 ---------- package.json | 6 ++---- version.json | 3 +++ 6 files changed, 8 insertions(+), 21 deletions(-) delete mode 100644 .git-version.json delete mode 100644 git-version.json create mode 100644 version.json diff --git a/.git-version.json b/.git-version.json deleted file mode 100644 index 04d44e690..000000000 --- a/.git-version.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "hash": "development" -} diff --git a/apps/red-ui/src/main.ts b/apps/red-ui/src/main.ts index fa84d6a05..159d77fb8 100644 --- a/apps/red-ui/src/main.ts +++ b/apps/red-ui/src/main.ts @@ -11,8 +11,8 @@ if (environment.production) { // https://github.com/angular/angular/issues/11195#issuecomment-248020928 async function bootstrap(appConfig: AppConfig) { - const packageJson = await import('.git-version.json'); - const config = { ...appConfig, FRONTEND_APP_VERSION: packageJson.hash }; + const packageJson = await import('version.json'); + const config = { ...appConfig, FRONTEND_APP_VERSION: packageJson.FRONTEND_APP_VERSION }; console.log('Started with local config: ', config); const appModule = appModuleFactory(config); diff --git a/docker/red-ui/Dockerfile b/docker/red-ui/Dockerfile index b61e71f2f..5d3ab0ccb 100644 --- a/docker/red-ui/Dockerfile +++ b/docker/red-ui/Dockerfile @@ -33,8 +33,7 @@ COPY .eslintrc.json .eslintrc.json COPY tsconfig.json tsconfig.json COPY paligo-styles paligo-styles COPY sonar.js sonar.js -COPY grab-git-info.js grab-git-info.js - +COPY version.json version.json ## Build the angular app in production mode and store the artifacts in dist folder # Fix auth issue then uncomment diff --git a/git-version.json b/git-version.json deleted file mode 100644 index c6ff5f937..000000000 --- a/git-version.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "dirty": true, - "raw": "a84073b85-dirty", - "hash": "a84073b85", - "distance": null, - "tag": null, - "semver": null, - "suffix": "a84073b85-dirty", - "semverString": null -} diff --git a/package.json b/package.json index f9f626843..42cf58b9b 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,7 @@ "license": "MIT", "scripts": { "build": "nx build", - "set-git-version": "node grab-git-info.js", - "build-lint-all": "node grab-git-info.js && nx build --project=red-ui --configuration production --base-href /ui/", + "build-lint-all": "nx build --project=red-ui --configuration production --base-href /ui/", "build-paligo-styles": "mkdir -p dist/paligo-styles && sass --load-path=. paligo-styles/style.scss > dist/paligo-styles/redacto-theme.css", "i18n:extract": "ngx-translate-extract --input ./apps/red-ui/src ./libs/common-ui/src --output apps/red-ui/src/assets/i18n/{redact,scm}/{en,de}.json --clean --sort --format namespaced-json && prettier apps/red-ui/src/assets/i18n/*/*.json --write", "nx": "nx", @@ -111,7 +110,6 @@ "typescript": "5.1.3", "webpack": "5.87.0", "webpack-bundle-analyzer": "^4.8.0", - "xliff": "^6.1.0", - "git-describe": "^4.1.1" + "xliff": "^6.1.0" } } diff --git a/version.json b/version.json new file mode 100644 index 000000000..c53a78472 --- /dev/null +++ b/version.json @@ -0,0 +1,3 @@ +{ + "FRONTEND_APP_VERSION": "development" +}