use of com.microsoft.azure.toolkit.lib.legacy.appservice.DockerImageType in project azure-gradle-plugins by microsoft.
the class AzureWebappPluginExtension method getTelemetryProperties.
public Map<String, String> getTelemetryProperties() {
final Map<String, String> result = new HashMap<>();
final GradleRuntimeConfig runtime = getRuntime();
final String os = java.util.Optional.ofNullable(runtime).map(GradleRuntimeConfig::os).orElse(null);
result.put(OS_KEY, os);
result.put(JAVA_VERSION_KEY, java.util.Optional.ofNullable(runtime).map(GradleRuntimeConfig::javaVersion).orElse(null));
result.put(JAVA_WEB_CONTAINER_KEY, java.util.Optional.ofNullable(runtime).map(GradleRuntimeConfig::webContainer).orElse(null));
result.put(PRICING_TIER_KEY, pricingTier);
result.put(REGION_KEY, region);
if (runtime != null && StringUtils.equalsIgnoreCase(os, OperatingSystem.DOCKER.getValue())) {
final boolean isCustomRegistry = StringUtils.isNotEmpty(runtime.registryUrl());
final DockerImageType imageType;
if (isCustomRegistry) {
imageType = StringUtils.isEmpty(runtime.password()) ? DockerImageType.PRIVATE_REGISTRY : DockerImageType.UNKNOWN;
} else {
imageType = StringUtils.isEmpty(runtime.password()) ? DockerImageType.PRIVATE_DOCKER_HUB : DockerImageType.PUBLIC_DOCKER_HUB;
}
result.put(DOCKER_IMAGE_TYPE_KEY, imageType.name());
} else {
result.put(DOCKER_IMAGE_TYPE_KEY, DockerImageType.NONE.toString());
}
final boolean isDeployToSlot = java.util.Optional.ofNullable(getDeploymentSlot()).map(GradleDeploymentSlotConfig::name).map(StringUtils::isNotEmpty).orElse(false);
result.put(DEPLOY_TO_SLOT_KEY, String.valueOf(isDeployToSlot));
result.put(SKIP_CREATE_RESOURCE_KEY, System.getProperty("azure.resource.create.skip", "false"));
return result;
}
Aggregations