Exemple #1
0
        private bool RunComponent(string action, ComponentRunContext runState)
        {
            Console.WriteLine("[{0:T}] Running '{1}' action", DateTime.Now, action);

            foreach (var log in mRootComponent.Run(action, runState))
            {
                Console.WriteLine("[{0:T}] {1}{2}", DateTime.Now, new string(' ', runState.Depth * 2), log);
                if (runState.Error)
                {
                    Console.WriteLine("[{0:T}] Blocking Errors Detected ):", DateTime.Now);
                    return(false);
                }
            }

            Console.WriteLine("\n[{0:T}] Success!\n", DateTime.Now);
            return(true);
        }
Exemple #2
0
        private void RunDeploy(string environment)
        {
            Program.Post(() =>
            {
                Console.WriteLine("[{0:T}] Shit's going down!\n", DateTime.Now);
                Beep("start");

                var runState = new ComponentRunContext(mConfiguration, environment);
                if (RunComponent(ActionConstants.Deploy, runState))
                {
                    Beep("success");
                }
                else
                {
                    Beep("error");
                }
            });
        }
 public DepthScopeImpl(ComponentRunContext runContext)
 {
     mRunContext = runContext;
     runContext.IncreaseDepth();
 }
        public static IEnumerable <string> Run(this IEnumerable <IComponent> components, string action, ComponentRunContext runContext)
        {
            foreach (var component in components)
            {
                foreach (var log in component.Run(action, runContext))
                {
                    yield return(log);

                    if (runContext.Error)
                    {
                        yield break;
                    }
                }
            }
        }
 public static IDisposable DepthScope(this ComponentRunContext runContext)
 {
     return(new DepthScopeImpl(runContext));
 }