Octopus doesn't just store information; it actively *does* things. Examples include deployments, checking that machines are online, automated database backups, and more. These "tasks" are queued and executed asynchronously, and their progress and logs can be monitored using the HTTP API. Some tasks are created automatically; for example, Octopus will automatically create a task to check the status of all machines every 5 minutes. Some tasks are created implicitly, such as when a deployment is created to execute the actual deployment. And some tasks can be created manually, such as backup tasks and sending test emails.
상속: Resource
 static IEnumerable<string> FormatTaskPropertiesAsStrings(TaskResource task)
 {
     return new List<string>
     {
         "Date: " + task.QueueTime,
         "Duration: " + task.Duration,
         "State: " + task.State
     };
 }
        public void Render(IOctopusRepository repository, ILog log, TaskResource resource)
        {
            var details = repository.Tasks.GetDetails(resource);

            if (details.ActivityLog != null)
            {
                foreach (var item in details.ActivityLog.Children)
                {
                    if (log.ServiceMessagesEnabled())
                    {
                        RenderToTeamCity(item, log);
                    }
                    else
                    {
                        RenderToConsole(item, log, "");                        
                    }
                }
            }
        }
        public void SetUp()
        {
            deployReleaseCommand = new DeployReleaseCommand(RepositoryFactory, Log, FileSystem);

            var project = new ProjectResource();
            var release = new ReleaseResource { Version = "1.0.0" };
            var releases = new ResourceCollection<ReleaseResource>(new[] { release }, new LinkCollection());
            var deploymentPromotionTarget = new DeploymentPromotionTarget { Name = "TestEnvironment" };
            var promotionTargets = new List<DeploymentPromotionTarget> { deploymentPromotionTarget };
            var deploymentTemplate = new DeploymentTemplateResource { PromoteTo = promotionTargets };
            var deploymentPreviewResource = new DeploymentPreviewResource { StepsToExecute = new List<DeploymentTemplateStep>() };
            var deployment = new DeploymentResource { TaskId = "1" };
            taskResource = new TaskResource();

            Repository.Projects.FindByName(ProjectName).Returns(project);
            Repository.Projects.GetReleases(project).Returns(releases);
            Repository.Releases.GetPreview(deploymentPromotionTarget).Returns(deploymentPreviewResource);
            Repository.Releases.GetTemplate(release).Returns(deploymentTemplate);
            Repository.Deployments.Create(Arg.Any<DeploymentResource>()).Returns(deployment);
            Repository.Tasks.Get(deployment.TaskId).Returns(taskResource);
        }
        public async Task Render(IOctopusAsyncRepository repository, ILogger log, TaskResource resource)
        {
            var details = await repository.Tasks.GetDetails(resource).ConfigureAwait(false);

            if (details.ActivityLogs != null)
            {
                foreach (var item in details.ActivityLogs)
                {
                    if (log.ServiceMessagesEnabled())
                    {
                        if (log.IsVSTS())
                            RenderToVSTS(item, log, "");
                        else
                            RenderToTeamCity(item, log);
                    }
                    else
                    {
                        RenderToConsole(item, log, "");                        
                    }
                }
            }
        }
 void PrintTaskOutput(TaskResource[] taskResources)
 {
     var task = taskResources.First();
     printer.Render(Repository, Log, task);
 }
예제 #6
0
 public string GetTaskRawOutputLog(TaskResource task)
 {
     return Repository.Tasks.GetRawOutputLog(task);
 }