示例#1
0
        internal List <string> GetPipelineQueueList(string toolName, string pipeline, string environment)
        {
            PipelineInfo     pipelineInfo = new PipelineInfo(toolName, pipeline, environment);
            ExecutionManager exeManager   = executionManagerDictionary[pipelineInfo.LockName];

            return(exeManager.GetQueueList());
        }
示例#2
0
        internal string AbortPipeline(string toolName, string pipeline, string environment, string pipelineInstanceName)
        {
            PipelineInfo     pipelineInfo = new PipelineInfo(toolName, pipeline, environment);
            ExecutionManager exeManager   = executionManagerDictionary[pipelineInfo.LockName];

            return(exeManager.AbortPipeline(pipelineInstanceName));
        }
        public string TriggerPipeline(string toolName, string pipeline, string environment, bool updatePlan)
        {
            PipelineInfo    pipelineInfo          = new PipelineInfo(toolName, pipeline, environment, updatePlan);
            PipelineManager pipelineManager       = new PipelineManager();
            var             triggerPipelineStatus = pipelineManager.AddToQueue(pipelineInfo);

            return(triggerPipelineStatus);
        }
        public string RerunPipeline(string toolName, string pipeline, string environment, string pipelineInstanceName, List <string> testCaseIds = null)
        {
            PipelineInfo    pipelineInfo        = new PipelineInfo(toolName, pipeline, environment, pipelineInstanceName: pipelineInstanceName, testCasesIds: testCaseIds);
            PipelineManager pipelineManager     = new PipelineManager();
            var             rerunPipelineStatus = pipelineManager.AddToQueue(pipelineInfo);

            return(rerunPipelineStatus);
        }
示例#5
0
        public string AddToQueue(PipelineInfo pipelineInfo)
        {
            ExecutionManager exeManager = null;

            if (!executionManagerDictionary.ContainsKey(pipelineInfo.LockName))
            {
                exeManager = new ExecutionManager(pipelineInfo);
                executionManagerDictionary[pipelineInfo.LockName] = exeManager;
            }
            exeManager = executionManagerDictionary[pipelineInfo.LockName];
            return(exeManager.AddToQueue(pipelineInfo));
        }
示例#6
0
 public string AddToQueue(PipelineInfo pipelineInfo)
 {
     if (PipelineQueue.Any(x => x.ConfigKey.Equals(pipelineInfo.ConfigKey)))
     {
         return("AlreadyInQueue");
     }
     PipelineQueue.Add(pipelineInfo);
     if (PipelineQueue.Where(x => x.Status == "Running").Count() == 0)
     {
         var task = Task.Run(() => { TriggerPipeline(PipelineQueue.FirstOrDefault()); });
     }
     return("AddedToQueue");
 }
示例#7
0
 private async void TriggerPipeline(PipelineInfo pipelineInfo)
 {
     pipelineInfo.Status = "Running";
     Task  task = new Task(StartPipelineExecution);
     await task;
 }
示例#8
0
 public ExecutionManager(PipelineInfo pipelineInfo)
 {
     //Task.Run(() => { TriggerPipeline(); });
 }