Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sams, Roland authored and Sams, Roland committed Mar 27, 2024
1 parent 82bb952 commit 268aa77
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 46 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build-deploy-mkj-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.publictest.ts"
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
Expand All @@ -108,7 +108,7 @@
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.gulaschmusi.ts"
"with": "src/environments/environment.prod.ts"
}
],
"assets": [
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/api/websocket.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 6 additions & 1 deletion src/configurations/_CONFIG_MAP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ export interface AppConfig {
appTitle: string;
production: boolean;
apiUrl: string;
wsHost: string;
publictest: boolean;
wsHost: string;
wsAppKey: string;
};
}

Expand All @@ -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/',
Expand All @@ -24,19 +26,22 @@ 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',
production: true,
apiUrl: 'https://api.mk-jainzen.at/api/',
wsHost: 'api.mk-jainzen.at',
publictest: false,
wsAppKey: 'akkq3uvoftnearumcyzb',
},
gmr: {
appTitle: 'gulaschAPP',
production: true,
apiUrl: 'https://api.gulaschmusi.at/api/',
wsHost: 'api.gulaschmusi.at',
publictest: false,
wsAppKey: 'akkq3uvoftnearumcyzb',
},
};
11 changes: 0 additions & 11 deletions src/environments/environment.gulaschmusi.ts

This file was deleted.

15 changes: 6 additions & 9 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -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',
};
11 changes: 0 additions & 11 deletions src/environments/environment.publictest.ts

This file was deleted.

15 changes: 6 additions & 9 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};

0 comments on commit 268aa77

Please sign in to comment.