in packages/cli/lib/mdaa-cli.ts [235:266]
public deployDomain(domain: MdaaDomainConfig, domainEffectiveConfig: DomainEffectiveConfig) {
if (!this.devopsMode) {
console.log(`-----------------------------------------------------------`);
console.log(`Domain ${domainEffectiveConfig.domainName}: Running ${this.action}`);
console.log(`-----------------------------------------------------------`);
}
if (this.envFilter && !this.devopsMode) {
console.log(`Domain ${domainEffectiveConfig.domainName}: Filtering for env ${this.envFilter}`);
}
Object.keys(domain.environments)
.filter(envName => this.devopsMode || this.envFilter == undefined || this.envFilter?.includes(envName))
.forEach(envName => {
const env = domain.environments[envName];
if (
env.template &&
(!domainEffectiveConfig.envTemplates || !domainEffectiveConfig.envTemplates[env.template])
) {
throw new Error(`Environment "${envName}" references invalid template name: ${env.template}.`);
}
const template =
env.template && domainEffectiveConfig.envTemplates ? domainEffectiveConfig.envTemplates[env.template] : {};
// nosemgrep
const _ = require('lodash');
const envMergedConfig = _.mergeWith(env, template);
const envEffectiveConfig: EnvEffectiveConfig = this.computeEnvEffectiveConfig(
envName,
envMergedConfig,
domainEffectiveConfig,
);
this.deployEnv(envMergedConfig, envEffectiveConfig);
});
}