import * as _ from 'lodash-es';
import { applicationOptions, deploymentOptions } from '../../../jdl/index.js';
import { loadDerivedPlatformConfig, loadPlatformConfig, loadDerivedServerAndPlatformProperties } from '../../server/support/index.mjs';
const { OptionNames } = applicationOptions;
const { Options: DeploymentOptions } = deploymentOptions;
const { JWT_SECRET_KEY } = OptionNames;
export function loadDeploymentConfig({ config = _.defaults({}, this.jhipsterConfig, DeploymentOptions.defaults(this.jhipsterConfig.deploymentType)), deployment = this, } = {}) {
    deployment.appsFolders = config.appsFolders;
    deployment.directoryPath = config.directoryPath;
    deployment.clusteredDbApps = config.clusteredDbApps;
    deployment.dockerRepositoryName = config.dockerRepositoryName;
    deployment.dockerPushCommand = config.dockerPushCommand;
    deployment.adminPassword = config.adminPassword;
    deployment.jwtSecretKey = config[JWT_SECRET_KEY];
    loadPlatformConfig({ config, application: deployment });
    loadDerivedPlatformConfig({ application: deployment });
    loadDerivedServerAndPlatformProperties({ application: deployment });
}
