alfresco-ng2-components/appConfigReplace.cloud.js
Maurizio Vitale abb76d956b e2e cloud (#4767)
* Change strategy with process cloud e2e and fixes

* Change strategy with process cloud e2e and fixes

* Fix path and host

* improve the config and run the replace for cloud

* Use the same name of other scripts

* Fix lint

* Run the replace in case of cloud

* typo

* Export variables if needed
Fix the check env passing the oauth
2019-05-23 10:24:32 +01:00

27 lines
1.1 KiB
JavaScript
Executable File

// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
require('dotenv').config( { path: './e2e/.env.cloud' });
const fs = require('fs');
const BPM_HOST = process.env.URL_HOST_BPM_ADF || "bpm";
const OAUTH_HOST = process.env.URL_HOST_SSO_ADF || "keycloak";
const IDENTITY_HOST = process.env.URL_HOST_IDENTITY || "identity";
const OAUTH_CLIENDID = process.env.OAUTH_CLIENDID || "activiti";
const AUTH_TYPE = process.env.AUTH_TYPE || "OAUTH";
const PROVIDERS = process.env.PROVIDERS || "BPM";
fs.readFile('./demo-shell/dist/app.config.json', (err, appConfigString) => {
if (err) throw err;
let appConfig = JSON.parse(appConfigString);
appConfig.bpmHost = BPM_HOST;
appConfig.authType = AUTH_TYPE;
appConfig.providers = PROVIDERS;
appConfig.identityHost = IDENTITY_HOST;
appConfig.oauth2.host = OAUTH_HOST;
appConfig.oauth2.clientId = OAUTH_CLIENDID;
let appConfigReplacedJson = JSON.stringify(appConfig);
fs.writeFileSync('./demo-shell/dist/app.config.json', appConfigReplacedJson);
});