Skip to content

Commit

Permalink
[MIGRATION] - Rebased and added a comment to check why script is failing
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoAlbano committed Aug 8, 2024
1 parent c3f14e4 commit c9b04e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"e2e": "./scripts/test-e2e-lib.sh -host 'localhost:4200' -dev --folder demo-shell",
"e2e-lib": "nx e2e lib-e2e-test --port=4200",
"lite-server-e2e": "lite-server --baseDir='dist/demo-shell/' -c ./e2e/lite-server-proxy.js",
"postbuild:ci": "node -r esm ./scripts/app-config-replace.js",
"postbuild:ci": "node ./scripts/app-config-replace.js",
"06": "echo -------------------------------------------- Clean ----------------------------------------------",
"clean": "rimraf dist node_modules dist/libs",
"playwright": "npx playwright test --config='e2e-playwright/playwright.config.ts'",
Expand Down
14 changes: 7 additions & 7 deletions scripts/app-config-replace.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

require('dotenv').config({path: process.env.ENV_FILE});
require('dotenv').config({ path: process.env.ENV_FILE });
const fs = require('fs');

console.log('==== REPLACING CONFIG VALUES =====');
const configPath = './dist/demo-shell/app.config.json';

fs.readFile(configPath, (err, appConfigString) => {
if (err) throw err;
let appConfig = JSON.parse(appConfigString);
appConfig.providers = process.env.PROVIDERS || 'ALL';
appConfig.bpmHost = (process.env.PROXY_HOST_ADF || process.env.URL_HOST_ADF);
appConfig.ecmHost = (process.env.PROXY_HOST_ADF || process.env.URL_HOST_ADF);
appConfig.identityHost = (process.env.HOST_SSO + '/auth/admin/realms/alfresco');
appConfig.oauth2.host = (process.env.HOST_SSO + '/auth/realms/alfresco');
appConfig.bpmHost = process.env.PROXY_HOST_ADF || process.env.URL_HOST_ADF;
appConfig.ecmHost = process.env.PROXY_HOST_ADF || process.env.URL_HOST_ADF;
appConfig.identityHost = process.env.HOST_SSO + '/auth/admin/realms/alfresco';
appConfig.oauth2.host = process.env.HOST_SSO + '/auth/realms/alfresco';
appConfig.notificationDefaultDuration = process.env.NOTIFICATION_LAST || 8000;
appConfig.authType = process.env.AUTH_TYPE || 'BASIC';

let appConfigReplacedJson = JSON.stringify(appConfig,null,4);

let appConfigReplacedJson = JSON.stringify(appConfig, null, 4);

fs.writeFileSync(configPath, appConfigReplacedJson);
});

0 comments on commit c9b04e2

Please sign in to comment.