Skip to content

Commit 9af5e2e

Browse files
committed
#58 replacing keys.json by keys.ts
1 parent 0de5d0d commit 9af5e2e

File tree

5 files changed

+16
-18
lines changed

5 files changed

+16
-18
lines changed

.github/workflows/CI-time-tracker-ui.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,11 @@ jobs:
4848
BASE_PATH: "src/environments/"
4949
run: |
5050
import os
51-
import json
52-
data = {}
5351
base_path = os.environ.get('BASE_PATH', 'src/environments/')
54-
with open(base_path + "keys.example.json", "r+") as jsonFileRead:
55-
data = json.load(jsonFileRead)
56-
data["scopes"] = str(os.environ['SCOPES']).split(",")
57-
data["client_id"] = os.environ['CLIENT_ID']
58-
data["authority"] = os.environ['AUTHORITY']
59-
with open(base_path + ".keys.json", "w+") as jsonFileWrite:
60-
json.dump(data, jsonFileWrite)
52+
with open(base_path + "keys.ts", "w") as fileWithKeys:
53+
fileWithKeys.write('export const AUTHORITY = ') + str(os.environ['SCOPES']).split(",") + ';';
54+
fileWithKeys.write('\nexport const CLIENT_ID = ' + os.environ['CLIENT_ID']) + ';';
55+
fileWithKeys.write('\nexport const SCOPES = ' + os.environ['AUTHORITY']) + ';';
6156
6257
- name: Run the test
6358
run: npm run ci-test --if-present
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import * as keys from './.keys.json';
1+
import * as keys from './keys';
22

33
export const environment = {
44
production: true
55
};
66

7-
export const AUTHORITY = keys.authority;
8-
export const CLIENT_ID = keys.client_id;
9-
export const SCOPES = keys.scopes;
7+
export const AUTHORITY = keys.AUTHORITY;
8+
export const CLIENT_ID = keys.CLIENT_ID;
9+
export const SCOPES = keys.SCOPES;

src/environments/environment.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// This file can be replaced during build by using the `fileReplacements` array.
22
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
33
// The list of file replacements can be found in `angular.json`.
4-
import * as keys from './.keys.json';
4+
import * as keys from './keys';
55

66
export const environment = {
77
production: false,
88
timeTrackerApiUrl: 'https://timetracker-api.azurewebsites.net'
99
};
1010

11-
export const AUTHORITY = keys.authority;
12-
export const CLIENT_ID = keys.client_id;
13-
export const SCOPES = keys.scopes;
11+
export const AUTHORITY = keys.AUTHORITY;
12+
export const CLIENT_ID = keys.CLIENT_ID;
13+
export const SCOPES = keys.SCOPES;
1414

1515
/*
1616
* For easier debugging in development mode, you can import the following file

src/environments/keys.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const AUTHORITY = 'XXX';
2+
export const CLIENT_ID = 'XXX';
3+
export const SCOPES = ['XXX'];

stryker.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"clear-text",
2727
"html"
2828
],
29-
"maxConcurrentTestRunners": 2,
29+
"maxConcurrentTestRunners": 4,
3030
"maxConcurrentTestRunners_comment": "Recommended to use about half of your available cores when running stryker with angular",
3131
"coverageAnalysis": "off"
3232
}

0 commit comments

Comments
 (0)