コード例 #1
0
ファイル: ChefRunner.cs プロジェクト: skreddy6673/cafe
        public Result Run(IMessagePresenter presenter, IRunChefPolicy runChefPolicy)
        {
            presenter.ShowMessage($"Running chef {runChefPolicy}");
            runChefPolicy.PrepareEnvironmentForChefRun();
            var process = _processCreator();

            process.LogEntryReceived += (sender, entry) =>
            {
                Logger.Debug($"Received log message from chef run: {entry.Entry}");
                presenter.ShowMessage(entry.Entry);
                entry.Log();
            };
            var argumentsForChefRun = runChefPolicy.ArgumentsForChefRun();
            var result = process.Run(argumentsForChefRun);

            presenter.ShowMessage($"Finished running chef with result: {result}");
            return(result);
        }
コード例 #2
0
 public Result Run(IMessagePresenter presenter, IRunChefPolicy chefBootstrapper)
 {
     WasRun       = true;
     Bootstrapper = chefBootstrapper;
     return(Result.Successful());
 }
コード例 #3
0
 public JobRunStatus Bootstrap(IRunChefPolicy bootstrapper)
 {
     return(OnRunReady(new JobRun($"Bootstrapping Chef with {bootstrapper}", messagePresenter => _chefRunner.Run(messagePresenter, bootstrapper), _clock)));
 }