use of com.microsoft.azure.toolkit.lib.legacy.function.configurations.RuntimeConfiguration in project azure-maven-plugins by microsoft.
the class ConfigParser method getRuntimeConfig.
public RuntimeConfig getRuntimeConfig() throws AzureExecutionException {
final RuntimeConfiguration runtime = mojo.getRuntimeConfiguration();
if (runtime == null) {
return null;
}
final OperatingSystem os = Optional.ofNullable(runtime.getOs()).map(OperatingSystem::fromString).orElse(null);
final JavaVersion javaVersion = Optional.ofNullable(runtime.getJavaVersion()).map(JavaVersion::fromString).orElse(null);
final RuntimeConfig result = new RuntimeConfig().os(os).javaVersion(javaVersion).webContainer(WebContainer.JAVA_OFF).image(runtime.getImage()).registryUrl(runtime.getRegistryUrl());
if (StringUtils.isNotEmpty(runtime.getServerId())) {
final MavenDockerCredentialProvider credentialProvider = MavenDockerCredentialProvider.fromMavenSettings(mojo.getSettings(), runtime.getServerId());
result.username(credentialProvider.getUsername()).password(credentialProvider.getPassword());
}
return result;
}
Aggregations