Пример #1
0
        public void run()
        {
            log.InfoFormat("Running with machineId={0}, masterIp={1}, masterPort={2}", ac.machineId, ac.masterIP, ac.masterPort);

            using (var client = new Dirigent.Net.AutoconClient(ac.machineId, ac.masterIP, ac.masterPort))
            {
                string rootForRelativePaths = System.IO.Path.GetDirectoryName(System.IO.Path.GetFullPath(ac.sharedCfgFileName));
                var    agent = new Dirigent.Agent.Core.Agent(ac.machineId, client, true, rootForRelativePaths);


                IEnumerable <ILaunchPlan> planRepo = (ac.scfg != null) ? ac.scfg.Plans : null;

                // if there is some local plan repo defined, use it for local operations
                if (planRepo != null)
                {
                    agent.LocalOps.SetPlanRepo(planRepo);
                }

                // start given plan if provided
                if (planRepo != null)
                {
                    agent.LocalOps.SelectPlan(ac.startupPlanName);
                }

                // tick forever
                while (true)
                {
                    agent.tick();
                    Thread.Sleep(500);
                }
            }
        }
Пример #2
0
        public void run()
        {
            log.InfoFormat("Running with machineId={0}, masterIp={1}, masterPort={2}", ac.machineId, ac.masterIP, ac.masterPort);

            using (var client = new Dirigent.Net.AutoconClient(ac.machineId, ac.masterIP, ac.masterPort))
            {

                var agent = new Dirigent.Agent.Core.Agent(ac.machineId, client, true);

                IEnumerable<ILaunchPlan> planRepo = (ac.scfg != null) ? ac.scfg.Plans : null;

                // if there is some local plan repo defined, use it for local operations
                if (planRepo != null)
                {
                    agent.LocalOps.SetPlanRepo(planRepo);
                }

                // start given plan if provided
                if (planRepo != null)
                {
                    ILaunchPlan startupPlan = AppHelper.GetPlanByName(planRepo, ac.startupPlanName);
                    if (startupPlan != null)
                    {
                        agent.LocalOps.SelectPlan(startupPlan);
                    }
                }

                // tick forever
                while (true)
                {
                    agent.tick();
                    Thread.Sleep(500);
                }
            }
        }