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: GitHub - 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: egov-mdms-data/data/pg/tenant/citymodule.json at UAT ยท egovernments/egov-mdms-data