use of com.microsoft.azure.maven.webapp.configuration.DeploymentSlotConfig in project azure-maven-plugins by microsoft.
the class DeployMojo method createOrUpdateResource.
private IWebAppBase<?> createOrUpdateResource() throws AzureExecutionException {
final boolean skipCreate = skipAzureResourceCreate || skipCreateAzureResource;
if (!isDeployToDeploymentSlot()) {
final AppServiceConfig appServiceConfig = getConfigParser().getAppServiceConfig();
IWebApp app = Azure.az(AzureAppService.class).webapp(appServiceConfig.resourceGroup(), appServiceConfig.appName());
final boolean newWebApp = !app.exists();
AppServiceConfig defaultConfig = !newWebApp ? fromAppService(app, app.plan()) : buildDefaultConfig(appServiceConfig.subscriptionId(), appServiceConfig.resourceGroup(), appServiceConfig.appName());
mergeAppServiceConfig(appServiceConfig, defaultConfig);
if (appServiceConfig.pricingTier() == null) {
appServiceConfig.pricingTier(appServiceConfig.runtime().webContainer() == WebContainer.JBOSS_7 ? PricingTier.PREMIUM_P1V3 : PricingTier.PREMIUM_P1V2);
}
final CreateOrUpdateWebAppTask task = new CreateOrUpdateWebAppTask(appServiceConfig);
task.setSkipCreateAzureResource(skipCreate);
return task.execute();
} else {
// todo: New CreateOrUpdateDeploymentSlotTask
final DeploymentSlotConfig config = getConfigParser().getDeploymentSlotConfig();
final IWebAppDeploymentSlot slot = getDeploymentSlot(config);
final boolean slotExists = slot.exists();
if (!slotExists && skipCreate) {
throwForbidCreateResourceWarning("Deployment slot", config.getName());
}
return slotExists ? updateDeploymentSlot(slot, config) : createDeploymentSlot(slot, config);
}
}
Aggregations