Пример #1
0
        public async Task Handle(ParseZoneModelOptions command)
        {
            var model = _parser.Parse(command.ZoneGroup, command.Region, command.Environment, command.Directory);

            if (command.StrongType)
            {
                Console.WriteLine("Strongly Typing Ids");
                // strongly type the names in the model
                model.ToStrongIds();
            }

            if (command.WriteToFile)
            {
                var path = Path.Join(Directory.GetCurrentDirectory(), "zone-variables.yaml");
                Console.WriteLine($"Creating {path}");
                await _fileWriter.WriteAsYaml(model, path, replace : true);
            }

            if (command.Graph)
            {
                var path = Path.Join(Directory.GetCurrentDirectory(), "zone.graph");
                Console.WriteLine($"Creating {path}");
                _graphWriter.WriteGraph(model, path);
            }
        }
Пример #2
0
 public async Task WriteConfigFile()
 {
     var sampleConfig = Samples.ConfigSample(_region, _environment, "hub");
     await _fileWriter.WriteAsYaml(sampleConfig, Path.Join(ZoneGroupDirectoryPath, "config.yaml"), replace : true);
 }