public JobExecutionResult ExecuteJob(MatrixJob job) { JobStarting?.Invoke(this, new JobStartingEventArgs(job)); var executionContext = new ExecutionContext( job, buildConfiguration, engineConfiguration.Outputter, engineConfiguration.RepositoryDirectoryPath, !string.IsNullOrEmpty(buildConfiguration.CloneFolder) ? buildConfiguration.CloneFolder : new ExpandableString(@"C:\Projects\LocalAppVeyorTempClone")); JobExecutionResult executionResult; try { var isSuccess = ExecuteBuildPipeline(executionContext); // on_success / on_failure only happen here, after we know the build status // they do intervene on build final status though isSuccess = isSuccess ? new OnSuccessStep(engineConfiguration.FileSystem, executionContext.CloneDirectory, buildConfiguration.OnSuccessScript).Execute(executionContext) : new OnFailureStep(engineConfiguration.FileSystem, executionContext.CloneDirectory, buildConfiguration.OnFailureScript).Execute(executionContext); return(isSuccess ? JobExecutionResult.CreateSuccess() : JobExecutionResult.CreateFailure()); } catch (SolutionNotFoundException) { executionResult = JobExecutionResult.CreateSolutionNotFound(); } catch (Exception e) { executionResult = JobExecutionResult.CreateUnhandledException(e); } finally { // on_finish don't influence build final status so we just run it new OnFinishStep(engineConfiguration.FileSystem, executionContext.CloneDirectory, buildConfiguration.OnFinishScript).Execute(executionContext); } JobEnded?.Invoke(this, new JobEndedEventArgs(job, executionResult)); return(executionResult); }
public JobExecutionResult ExecuteJob(MatrixJob job) { JobStarting?.Invoke(this, new JobStartingEventArgs(job)); var executionContext = new ExecutionContext( job, _buildConfiguration, _engineConfiguration.Outputter, _engineConfiguration.RepositoryDirectoryPath, !string.IsNullOrEmpty(_buildConfiguration.CloneFolder) ? _buildConfiguration.CloneFolder : new ExpandableString(_engineConfiguration.FallbackCloneDirectoryPath), _engineConfiguration.FileSystem); var executionResult = new BuildPipelineExecuter(executionContext).Execute(); JobEnded?.Invoke(this, new JobEndedEventArgs(job, executionResult)); return(executionResult); }
public JobEndedEventArgs(MatrixJob job, JobExecutionResult executionResult) { Job = job; ExecutionResult = executionResult; }
public JobStartingEventArgs(MatrixJob job) { Job = job; }