UI build preparation for new instance
Code Path: https://github.com/egovernments/DIGIT-Dev
1. Global config file:
We need to create global config file for each instance.
Example: UAT instance
s3 bucket file Path: https://s3.ap-south-1.amazonaws.com/egov-uat-assets/globalConfigs.js
In this file, we need to add below content.
var globalConfigs = (function () {
var stateTenantId = 'pg'
var gmaps_api_key_old = 'AIzaSyAQOd09-vjmk1sXFb_ZQYDz2nlfhXq7Wf8'
var gmaps_api_key = 'AIzaSyASqkAr3d494ihZaJeCOg4CJ3xnQ_83e2s'
var finEnv = 'uat'
var centralInstanceEnabled = false;
var footerBWLogoURL = 'https://s3.ap-south-1.amazonaws.com/egov-uat-assets/digit-footer-bw.png'
var footerLogoURL = 'https://s3.ap-south-1.amazonaws.com/egov-uat-assets/digit-footer.png'
var digitHomeURL = 'https://www.digit.org/'
var assetS3Bucket = 'pg-egov-assets';
var getConfig = function (key) {
if (key === 'STATE_LEVEL_TENANT_ID') {
return stateTenantId;
}
else if (key === 'GMAPS_API_KEY') {
return gmaps_api_key;
}
else if (key === 'FIN_ENV') {
return finEnv;
} else if (key === 'ENABLE_SINGLEINSTANCE') {
return centralInstanceEnabled;
} else if (key === 'DIGIT_FOOTER_BW') {
return footerBWLogoURL;
} else if (key === 'DIGIT_FOOTER') {
return footerLogoURL;
} else if (key === 'DIGIT_HOME_URL') {
return digitHomeURL;
} else if (key === 'S3BUCKET') {
return assetS3Bucket;
} else if (key === "JWT_TOKEN"){
return "ZWdvdi11c2VyLWNsaWVudDo=";
}
};
return {
getConfig
};
}());
In this file,
Change the “stateTenantId” as per instance, here it is ‘pg’.
Change the “finEnv” as per instance, here it is ‘uat’.
Change the “footerBWLogoURL” as per instance, here it is ‘'https://s3.ap-south-1.amazonaws.com/egov-uat-assets/digit-footer-bw.png'’(this is s3 link for footer image).
Change the “footerLogoURL” as per instance, here it is ‘'https://s3.ap-south-1.amazonaws.com/egov-uat-assets/digit-footer.png'’(this is s3 link for footer image).
Change the “digitHomeURL” as per instance, here it is “https://www.digit.org/ ”.
Change the “assetS3Bucket” as per instance, here it is “pg-egov-assets”.
If you want to change the google maps key, need to change here “gmaps_api_key”
if “centralInstanceEnabled” is set to false, the logic will work in the UI by default , if “centralInstanceEnabled” is set to true, the central instance logic will work.
The Devops team will create this file while creating the new instance.
At last we need to add this file path in environment folder in devops repo.
Ex:
Digit UI repo path: https://github.com/egovernments/DIGIT-DevOps
UAT File Path: https://github.com/egovernments/DIGIT-DevOps/blob/master/deploy-as-code/helm/environments/uat.yaml
These details are mandatory for creating new instance build.
Enabling Modules:
We are enabling the modules by using the mdms config by active true or false.
Mdms File Path of UAT: https://github.com/egovernments/egov-mdms-data/blob/UAT/data/pg/tenant/citymodule.json