예제 #1
0
        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);
        }
예제 #2
0
파일: Engine.cs 프로젝트: kauktus/appveyor
        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);
        }
예제 #3
0
 public JobEndedEventArgs(MatrixJob job, JobExecutionResult executionResult)
 {
     Job             = job;
     ExecutionResult = executionResult;
 }
예제 #4
0
 public JobStartingEventArgs(MatrixJob job)
 {
     Job = job;
 }