public Environment(String environment) { this.environment = com.yahoo.config.provision.Environment.from(environment); } }
/** This may be invoked by a continuous build */ public static void main(String[] args) { if (args.length != 2 && args.length != 3) { System.err.println("Usage: DeploymentSpec [file] [environment] [region]?" + "Returns 0 if the specified zone matches the deployment spec, 1 otherwise"); System.exit(1); } try (BufferedReader reader = new BufferedReader(new FileReader(args[0]))) { DeploymentSpec spec = DeploymentSpec.fromXml(reader); Environment environment = Environment.from(args[1]); Optional<RegionName> region = args.length == 3 ? Optional.of(RegionName.from(args[2])) : Optional.empty(); if (spec.includes(environment, region)) System.exit(0); else System.exit(1); } catch (Exception e) { System.err.println("Exception checking deployment spec: " + toMessageString(e)); System.exit(1); } }
public static ZoneId from(String environment, String region) { return from(Environment.from(environment), RegionName.from(region)); }
public static ZoneId from(String environment, String region, String cloud) { return new ZoneId(Environment.from(environment), RegionName.from(region), CloudName.from(cloud)); }
public void setContainerCluster(ContainerCluster containerCluster) { this.containerCluster = containerCluster; // If we are in a config server cluster the correct zone is propagated through cloud config options, // not through config to deployment options (see StandaloneContainerApplication.scala), // so we need to propagate the zone options into the container from here Environment environment = options.environment().isPresent() ? Environment.from(options.environment().get()) : Environment.defaultEnvironment(); RegionName region = options.region().isPresent() ? RegionName.from(options.region().get()) : RegionName.defaultName(); SystemName system = options.system().isPresent() ? SystemName.from(options.system().get()) : SystemName.defaultSystem(); containerCluster.setZone(new Zone(system, environment, region)); }
@Inject public Zone(ConfigserverConfig configserverConfig, NodeFlavors nodeFlavors) { this(SystemName.from(configserverConfig.system()), Environment.from(configserverConfig.environment()), RegionName.from(configserverConfig.region()), new FlavorDefaults(configserverConfig), nodeFlavors); }
if ( ! isEnvironmentName(environmentTag.getTagName())) continue; Environment environment = Environment.from(environmentTag.getTagName());