Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#58 replacing keys.json by keys.ts
  • Loading branch information
enriquezrene committed Apr 9, 2020
commit 9af5e2eb02b61091c514c2e98a3d4745c3d16890
13 changes: 4 additions & 9 deletions .github/workflows/CI-time-tracker-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,11 @@ jobs:
BASE_PATH: "src/environments/"
run: |
import os
import json
data = {}
base_path = os.environ.get('BASE_PATH', 'src/environments/')
with open(base_path + "keys.example.json", "r+") as jsonFileRead:
data = json.load(jsonFileRead)
data["scopes"] = str(os.environ['SCOPES']).split(",")
data["client_id"] = os.environ['CLIENT_ID']
data["authority"] = os.environ['AUTHORITY']
with open(base_path + ".keys.json", "w+") as jsonFileWrite:
json.dump(data, jsonFileWrite)
with open(base_path + "keys.ts", "w") as fileWithKeys:
fileWithKeys.write('export const AUTHORITY = ') + str(os.environ['SCOPES']).split(",") + ';';
fileWithKeys.write('\nexport const CLIENT_ID = ' + os.environ['CLIENT_ID']) + ';';
fileWithKeys.write('\nexport const SCOPES = ' + os.environ['AUTHORITY']) + ';';

- name: Run the test
run: npm run ci-test --if-present
8 changes: 4 additions & 4 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as keys from './.keys.json';
import * as keys from './keys';

export const environment = {
production: true
};

export const AUTHORITY = keys.authority;
export const CLIENT_ID = keys.client_id;
export const SCOPES = keys.scopes;
export const AUTHORITY = keys.AUTHORITY;
export const CLIENT_ID = keys.CLIENT_ID;
export const SCOPES = keys.SCOPES;
8 changes: 4 additions & 4 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
import * as keys from './.keys.json';
import * as keys from './keys';

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

export const AUTHORITY = keys.authority;
export const CLIENT_ID = keys.client_id;
export const SCOPES = keys.scopes;
export const AUTHORITY = keys.AUTHORITY;
export const CLIENT_ID = keys.CLIENT_ID;
export const SCOPES = keys.SCOPES;

/*
* For easier debugging in development mode, you can import the following file
Expand Down
3 changes: 3 additions & 0 deletions src/environments/keys.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const AUTHORITY = 'XXX';
export const CLIENT_ID = 'XXX';
export const SCOPES = ['XXX'];
2 changes: 1 addition & 1 deletion stryker.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"clear-text",
"html"
],
"maxConcurrentTestRunners": 2,
"maxConcurrentTestRunners": 4,
"maxConcurrentTestRunners_comment": "Recommended to use about half of your available cores when running stryker with angular",
"coverageAnalysis": "off"
}