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); }
public Result Run(IMessagePresenter presenter, IRunChefPolicy chefBootstrapper) { WasRun = true; Bootstrapper = chefBootstrapper; return(Result.Successful()); }
public JobRunStatus Bootstrap(IRunChefPolicy bootstrapper) { return(OnRunReady(new JobRun($"Bootstrapping Chef with {bootstrapper}", messagePresenter => _chefRunner.Run(messagePresenter, bootstrapper), _clock))); }