public static final String getEnvironmentOrPropertyVariable(String property) { return getEnvironmentOrPropertyVariable(property, null); }
public static final String getEnvironmentOrPropertyVariable(String property) { return getEnvironmentOrPropertyVariable(property, null); }
private boolean isDockerCertPathSet() { return Strings.isNotNullOrEmpty(SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_CERT_PATH)); }
private boolean isDockerHostSet() { return Strings.isNotNullOrEmpty(SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_HOST)); }
private boolean isDockerMachineNameSet() { return Strings.isNotNullOrEmpty(SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_MACHINE_NAME)); }
private boolean isDockerMachineNameSet() { return Strings.isNotNullOrEmpty(SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_MACHINE_NAME)); }
private boolean isDockerCertPathSet() { return Strings.isNotNullOrEmpty(SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_CERT_PATH)); }
private boolean isDockerTlsVerifySet() { return Strings.isNotNullOrEmpty(SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_TLS_VERIFY)); }
private boolean isDockerHostSet() { return Strings.isNotNullOrEmpty(SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_HOST)); }
private boolean isDockerTlsVerifySet() { return Strings.isNotNullOrEmpty(SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_TLS_VERIFY)); }
private Map<String, String> resolveSystemEnvironmentVariables(Map<String, String> config) { if (!config.containsKey(CubeDockerConfiguration.DOCKER_URI) && isDockerHostSet()) { String dockerHostUri = SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_HOST); config.put(CubeDockerConfiguration.DOCKER_URI, dockerHostUri); } if (!config.containsKey(CubeDockerConfiguration.CERT_PATH) && isDockerCertPathSet()) { String dockerCertPath = SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_CERT_PATH); config.put(CubeDockerConfiguration.CERT_PATH, dockerCertPath); } if (!config.containsKey(CubeDockerConfiguration.DOCKER_MACHINE_NAME) && isDockerMachineNameSet()) { String dockerMachineName = SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_MACHINE_NAME); config.put(CubeDockerConfiguration.DOCKER_MACHINE_NAME, dockerMachineName); } if (!config.containsKey(CubeDockerConfiguration.TLS_VERIFY) && isDockerTlsVerifySet()) { config.put(CubeDockerConfiguration.TLS_VERIFY, Boolean.TRUE.toString()); } return config; }
private Map<String, String> resolveSystemEnvironmentVariables(Map<String, String> config) { if (!config.containsKey(CubeDockerConfiguration.DOCKER_URI) && isDockerHostSet()) { String dockerHostUri = SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_HOST); config.put(CubeDockerConfiguration.DOCKER_URI, dockerHostUri); } if (!config.containsKey(CubeDockerConfiguration.CERT_PATH) && isDockerCertPathSet()) { String dockerCertPath = SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_CERT_PATH); config.put(CubeDockerConfiguration.CERT_PATH, dockerCertPath); } if (!config.containsKey(CubeDockerConfiguration.DOCKER_MACHINE_NAME) && isDockerMachineNameSet()) { String dockerMachineName = SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_MACHINE_NAME); config.put(CubeDockerConfiguration.DOCKER_MACHINE_NAME, dockerMachineName); } if (!config.containsKey(CubeDockerConfiguration.TLS_VERIFY) && isDockerTlsVerifySet()) { config.put(CubeDockerConfiguration.TLS_VERIFY, Boolean.TRUE.toString()); } return config; }
public static String getDockerRegistry(Map<String, String> map) throws MalformedURLException { String registry = SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_REGISTY); if (Strings.isNotNullOrEmpty(registry)) { return registry; } String registryHost = SystemEnvironmentVariables.getEnvironmentVariable(DOCKER_REGISTRY_HOST); String registryPort = SystemEnvironmentVariables.getEnvironmentVariable(DOCKER_REGISTRY_PORT); if (Strings.isNotNullOrEmpty(registry) && Strings.isNotNullOrEmpty(registryPort)) { return String.format(DOCKER_REGISTRY_FORMAT, registryHost, registryPort); } if (map.containsKey(DOCKER_REGISTY)) { return map.get(DOCKER_REGISTY); } return null; }
public static String getDockerRegistry(Map<String, String> map) throws MalformedURLException { String registry = SystemEnvironmentVariables.getEnvironmentOrPropertyVariable(DOCKER_REGISTY); if (Strings.isNotNullOrEmpty(registry)) { return registry; } String registryHost = SystemEnvironmentVariables.getEnvironmentVariable(DOCKER_REGISTRY_HOST); String registryPort = SystemEnvironmentVariables.getEnvironmentVariable(DOCKER_REGISTRY_PORT); if (Strings.isNotNullOrEmpty(registry) && Strings.isNotNullOrEmpty(registryPort)) { return String.format(DOCKER_REGISTRY_FORMAT, registryHost, registryPort); } if (map.containsKey(DOCKER_REGISTY)) { return map.get(DOCKER_REGISTY); } return null; }