static void Main(string[] args)
        {
            Parser.Default.ParseArguments <Options>(args)
            .WithParsed <Options>(o =>
            {
                if (o.Command.StartsWith("e"))
                {
                    var connection = new VssConnection(
                        new Uri(o.AccountUri), new VssBasicCredential(string.Empty, o.AccessToken)
                        );

                    var projectsGenerator = new ProjectsGenerator()
                    {
                        BaseFolder = o.DefinitionsFolder
                    };
                    projectsGenerator.Generate(connection);

                    var processGenerator = new ProcessGenerator()
                    {
                        BaseFolder = o.DefinitionsFolder
                    };
                    processGenerator.Generate(connection);
                }
                else if (o.Command.StartsWith("i"))
                {
                    var connection = new VssConnection(new Uri(o.AccountUri), new VssBasicCredential(string.Empty, o.AccessToken));

                    ReCreateEnvironment(o.DefinitionsFolder, connection);
                }
            });
        }
Beispiel #2
0
        public void LoadOrCreateProcessRoles()
        {
            var processGen = new ProcessGenerator();
            var groupGen   = new GroupGenerator();
            var queueGen   = new WorkQueueGenerator();

            Load = processGen.GetOrCreate(Simulator.GetProcessName("Load"));
            OnProgressMessage(string.Format("Get or create {0}", Load.Name));
            Main = processGen.GetOrCreate(Simulator.GetProcessName("Main"));
            OnProgressMessage(string.Format("Get or create {0}", Main.Name));
            Execute = processGen.GetOrCreate(Simulator.GetProcessName("Execute"));
            OnProgressMessage(string.Format("Get or create {0}", Execute.Name));
            Load.Groups    = groupGen.GetOrCreate(Load, Simulator.Region, Simulator.ServiceLine, Simulator.BusinessUnit, Simulator.GetProcessGroup());
            Main.Groups    = groupGen.GetOrCreate(Main, Simulator.Region, Simulator.ServiceLine, Simulator.BusinessUnit, Simulator.GetProcessGroup());
            Execute.Groups = groupGen.GetOrCreate(Execute, Simulator.Region, Simulator.ServiceLine, Simulator.BusinessUnit, Simulator.GetProcessGroup());
            Main.Queue     = queueGen.GetOrCreate(Simulator.GetProcessName("WQ"));
            OnProgressMessage(string.Format("Get or create {0}", Main.Queue.Name));
        }