From 268aa771cf0e686bf85eb594a0ebe2dd93f6bdf3 Mon Sep 17 00:00:00 2001 From: "Sams, Roland" Date: Wed, 27 Mar 2024 12:19:48 +0100 Subject: [PATCH] test --- .github/workflows/build-deploy-mkj-test.yml | 9 +++++++-- angular.json | 4 ++-- src/app/services/api/websocket.service.ts | 2 +- src/configurations/_CONFIG_MAP.ts | 7 ++++++- src/environments/environment.gulaschmusi.ts | 11 ----------- src/environments/environment.prod.ts | 15 ++++++--------- src/environments/environment.publictest.ts | 11 ----------- src/environments/environment.ts | 15 ++++++--------- 8 files changed, 28 insertions(+), 46 deletions(-) delete mode 100644 src/environments/environment.gulaschmusi.ts delete mode 100644 src/environments/environment.publictest.ts diff --git a/.github/workflows/build-deploy-mkj-test.yml b/.github/workflows/build-deploy-mkj-test.yml index fd4890c..7af4ddc 100644 --- a/.github/workflows/build-deploy-mkj-test.yml +++ b/.github/workflows/build-deploy-mkj-test.yml @@ -18,9 +18,14 @@ jobs: node-version: 20 cache: "npm" - - name: Change environment + - name: Update environment file run: | - sed -i 's/config.appTitle/"${{secrets.FTP_SERVER}}"/g' src/environments/environment.publictest.ts + sed -i 's/'production'/"${{secrets.TEST_PRODUCTION}}"/g' src/environments/environment.prod.ts + sed -i 's/'publictest'/"${{secrets.TEST_PUBLICTEST}}"/g' src/environments/environment.prod.ts + sed -i 's/'appTitle'/"${{secrets.TEST_APPTITLE}}"/g' src/environments/environment.prod.ts + sed -i 's/'apiUrl'/"${{secrets.TEST_APIURL}}"/g' src/environments/environment.prod.ts + sed -i 's/'wsHost'/"${{secrets.TEST_WSHOST}}"/g' src/environments/environment.prod.ts + sed -i 's/'wsAppKey'/"${{secrets.TEST_WSAPPKEY}}"/g' src/environments/environment.prod.ts - name: Install dependencies run: npm ci diff --git a/angular.json b/angular.json index 7e94aee..1ffc747 100644 --- a/angular.json +++ b/angular.json @@ -82,7 +82,7 @@ "fileReplacements": [ { "replace": "src/environments/environment.ts", - "with": "src/environments/environment.publictest.ts" + "with": "src/environments/environment.prod.ts" } ], "outputHashing": "all" @@ -108,7 +108,7 @@ "fileReplacements": [ { "replace": "src/environments/environment.ts", - "with": "src/environments/environment.gulaschmusi.ts" + "with": "src/environments/environment.prod.ts" } ], "assets": [ diff --git a/src/app/services/api/websocket.service.ts b/src/app/services/api/websocket.service.ts index 1bd733c..8e9348b 100644 --- a/src/app/services/api/websocket.service.ts +++ b/src/app/services/api/websocket.service.ts @@ -35,7 +35,7 @@ export class WebsocketService { (window as any).Pusher = Pusher; this._echo = new Echo({ broadcaster: 'reverb', - key: 'akkq3uvoftnearumcyzb', + key: environment.wsAppKey, wsHost: environment.wsHost, wsPort: environment.production ? 443 : 8080, wssPort: environment.production ? 443 : 8080, diff --git a/src/configurations/_CONFIG_MAP.ts b/src/configurations/_CONFIG_MAP.ts index bb131ca..17318f3 100644 --- a/src/configurations/_CONFIG_MAP.ts +++ b/src/configurations/_CONFIG_MAP.ts @@ -3,8 +3,9 @@ export interface AppConfig { appTitle: string; production: boolean; apiUrl: string; - wsHost: string; publictest: boolean; + wsHost: string; + wsAppKey: string; }; } @@ -13,6 +14,7 @@ export const CONFIG_MAP: AppConfig = { production: false, publictest: true, wsHost: 'localhost', + wsAppKey: 'akkq3uvoftnearumcyzb', apiUrl: 'http://localhost:8000/api/', // apiUrl: 'https://api-test.mk-jainzen.at/api/', @@ -24,6 +26,7 @@ export const CONFIG_MAP: AppConfig = { apiUrl: 'https://api-test.mk-jainzen.at/api/', wsHost: 'api-test.mk-jainzen.at', publictest: true, + wsAppKey: 'akkq3uvoftnearumcyzb', }, mkj: { appTitle: 'mkjAPP', @@ -31,6 +34,7 @@ export const CONFIG_MAP: AppConfig = { apiUrl: 'https://api.mk-jainzen.at/api/', wsHost: 'api.mk-jainzen.at', publictest: false, + wsAppKey: 'akkq3uvoftnearumcyzb', }, gmr: { appTitle: 'gulaschAPP', @@ -38,5 +42,6 @@ export const CONFIG_MAP: AppConfig = { apiUrl: 'https://api.gulaschmusi.at/api/', wsHost: 'api.gulaschmusi.at', publictest: false, + wsAppKey: 'akkq3uvoftnearumcyzb', }, }; diff --git a/src/environments/environment.gulaschmusi.ts b/src/environments/environment.gulaschmusi.ts deleted file mode 100644 index 9512d42..0000000 --- a/src/environments/environment.gulaschmusi.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { CONFIG_MAP } from '../configurations/_CONFIG_MAP'; - -const config = CONFIG_MAP.gmr; - -export const environment = { - production: config.production, - apiUrl: config.apiUrl, - appTitle: config.appTitle, - publictest: config.publictest, - wsHost: config.wsHost, -}; diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 1660658..9ccf1db 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,11 +1,8 @@ -import { CONFIG_MAP } from '../configurations/_CONFIG_MAP'; - -const config = CONFIG_MAP.mkj; - export const environment = { - production: config.production, - apiUrl: config.apiUrl, - appTitle: config.appTitle, - publictest: config.publictest, - wsHost: config.wsHost, + production: 'production', + publictest: 'publictest', + appTitle: 'appTitle', + apiUrl: 'apiUrl', + wsHost: 'wsHost', + wsAppKey: 'wsAppKey', }; diff --git a/src/environments/environment.publictest.ts b/src/environments/environment.publictest.ts deleted file mode 100644 index d672395..0000000 --- a/src/environments/environment.publictest.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { CONFIG_MAP } from '../configurations/_CONFIG_MAP'; - -const config = CONFIG_MAP.publictest; - -export const environment = { - production: config.production, - apiUrl: config.apiUrl, - appTitle: config.appTitle, - publictest: config.publictest, - wsHost: config.wsHost, -}; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 12101fb..82be483 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -3,14 +3,11 @@ // `ng build --env=prod` then `environment.prod.ts` will be used instead. // The list of which env maps to which file can be found in `.angular-cli.json`. -import { CONFIG_MAP } from '../configurations/_CONFIG_MAP'; - -const config = CONFIG_MAP.local; - export const environment = { - production: config.production, - apiUrl: config.apiUrl, - wsHost: config.wsHost, - appTitle: config.appTitle, - publictest: config.publictest, + production: true, + publictest: true, + appTitle: 'mkjLOCAL', + apiUrl: 'http://localhost:8000/api/', + wsHost: 'localhost', + wsAppKey: 'akkq3uvoftnearumcyzb', };