...
Code Block | ||
---|---|---|
| ||
https://github.com/egovernments/Train-InfraOps/blob/master/helm/environments/qa.yaml https://github.com/egovernments/Train-InfraOps/blob/master/helm/environments/uatdev.yaml |
Database configuration
Add or update the db url in the environment specific file using the below property.
...
Update the db username and password, which are configured in the environment named secrets yaml file.
For example, for the qa dev environment, update the qadev-secrets.yaml.
Code Block | ||
---|---|---|
| ||
secrets: db: username: <username value> password: <password value> |
...
Here citya.egovernments.org, cityb.egovernments.org are the domains and citya, cityb are the schemas/tenants.
Example environment specific configuration file for your reference.
Update the domainurl in the eg_city table.
Domain URL value should be the same as configured tenant domain_name
Ex:Code Block language java For citya, domain url should be citya.egovernments.org For cityb, domain url should be cityb.egovernments.org
...
MDMS serach url is configured in the Application Configuration file.
Sub domain formation logic in front end employee app
Finance coexistence follows schema per ulb structure and each city requires one sub domain. Sub domain formation for the different environments is happening dynamically by reading the environment value from the FIN_ENV environment variable in the js file.
The following code snippet shows the sub domain formation logic
Code Block | ||
---|---|---|
| ||
locale = localStorage.getItem("locale"),
menuUrl = this.props.location.pathname,
loc = window.location,
subdomainurl,
domainurl,
finEnv,
hostname = loc.hostname,
winheight = window.innerHeight - 100,
erp_url,
tenantId = getTenantId();
domainurl = hostname.substring(hostname.indexOf(".") + 1);
finEnv = this.globalConfigExists() ? window.globalConfigs.getConfig("FIN_ENV") : process.env.REACT_APP_FIN_ENV;
subdomainurl = !!(finEnv) ? "-" + finEnv + "." + domainurl : "." + domainurl;
erp_url = loc.protocol + "//" + getTenantId().split(".")[1] + subdomainurl + menuUrl;
console.log("ERP URL : " + erp_url); |
The FIN_ENV variable is configurable and configured in the globalConfigs.js which is present (to be created if not present) in the S3 Bucket. The following code snippet shows the same.
Code Block |
---|
var globalConfigs = (function() {
var stateTenantId = 'pb'
var finEnv = 'dev'
var getConfig = function(key) {
if(key === 'STATE_LEVEL_TENANT_ID'){
return stateTenantId;
} else if(key === 'FIN_ENV'){
return finEnv;
}
};
return {
getConfig
};
}()); |
The following are some examples
Code Block | ||
---|---|---|
| ||
EX 1:
Domain url : citya.digit.org
Sub domain url: citya-uat.digit.org
Then configure the FIN_ENV variable as 'uat' like below
FIN_ENV='uat'
EX 2:
Domain url : staging.digit.org
Sub domain url: citya.digit.org
Then configure the FIN_ENV variable as 'uat' like below
FIN_ENV=''
EX 3:
Domain url : dev.digit.org
Sub domain url: amritsar-dev.digit.org
Then configure the FIN_ENV variable as 'uat' like below
FIN_ENV='dev'
|
The globalConfigs.js file is custom injected in the environment specific yaml files. The following code snippet shows the same.
Code Block | ||
---|---|---|
| ||
employee:
custom-js-injection: |
sub_filter.conf: "
sub_filter '<head>' '<head>
<script src=https://s3.ap-south-1.amazonaws.com/egov-telemetry-data/egov-telemetry-1557467338.js type=text/javascript></script>
<script src=https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js type=text/javascript></script>
<link rel=stylesheet href=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/dashboard-iframe-fix.css>
';"
|
The sample environment yaml files for your reference
Code Block | ||
---|---|---|
| ||
https://github.com/egovernments/Train-InfraOps/blob/master/helm/environments/dev.yaml |
Changes required to setup workspace in local machine
...
Title | Link |
---|---|
API Contracts | |
Co-existence finance code available | |
Sample client implementation repository | |
Configuring MDMS | |
Adding new service and CI/CD |