コード例 #1
0
        /// <summary>
        /// Returns the full log of a task
        /// </summary>
        /// <param name="octRepository">The repository to call against.</param>
        /// <param name="task">Task to gather.</param>
        /// <returns>String of the whole log</returns>
        public static string GetFullLog(OctopusRepository octRepository, TaskResource task)
        {
            var activitySteps = GetActivityElementList(octRepository, task);
            var output        = string.Empty;

            foreach (var activityStep in activitySteps)
            {
                output += ActivityElementHelper.GetLogInfo(activityStep, 0, null) + ResourceStrings.Return;
            }
            return(output.Trim());
        }
コード例 #2
0
        /// <summary>
        /// Gathers the Step name of the interruption from the CorrelationId
        /// </summary>
        /// <param name="octRepository"></param>
        /// <param name="interruption"></param>
        /// <returns></returns>
        public static string GetInterruptedStepName(OctopusRepository octRepository, InterruptionResource interruption)
        {
            var task             = TaskHelper.GetTaskFromId(octRepository, interruption.TaskId);
            var activityElements = TaskHelper.GetActivityElementList(octRepository, task);
            var stepName         = string.Empty;

            foreach (var activityElement in activityElements)
            {
                if (string.IsNullOrEmpty(stepName))
                {
                    stepName = ActivityElementHelper.GetStepNameById(activityElement, interruption.CorrelationId);
                }
            }
            return(stepName);
        }
コード例 #3
0
        /// <summary>
        /// Returns only warnings from a task.
        /// </summary>
        /// <param name="octRepository">The repository to call against.</param>
        /// <param name="task">Task to gather.</param>
        /// <returns>A string of warnings</returns>
        public static string GetWarnings(OctopusRepository octRepository, TaskResource task)
        {
            var activitySteps = GetActivityElementList(octRepository, task);
            var output        = string.Empty;
            var statusList    = new List <ActivityStatus>
            {
                ActivityStatus.SuccessWithWarning
            };

            foreach (var activityStep in activitySteps.Where(a => a.Status == ActivityStatus.SuccessWithWarning))
            {
                output += ActivityElementHelper.GetLogInfo(activityStep, 0, statusList) + ResourceStrings.Return;
            }
            return(output.Trim());
        }