예제 #1
0
        public override ActionDescription GetActionDescription()
        {
            var shortDesc = new ShortActionDescription();

            if (string.IsNullOrWhiteSpace(this.ConfigurationName))
            {
                shortDesc.AppendContent("Create Skytap Configuration");
            }
            else
            {
                shortDesc.AppendContent(
                    "Create ",
                    new Hilite(this.ConfigurationName),
                    " Skytap Environment"
                    );
            }

            var longDesc = new LongActionDescription(
                "from ",
                new Hilite(this.TemplateName)
                );

            if (this.ExportVariables)
            {
                longDesc.AppendContent(
                    ", and set ${Skytap-EnvironmentId} to the environment ID"
                    );
            }

            return(new ActionDescription(
                       shortDesc,
                       longDesc
                       ));
        }
        public override ActionDescription GetActionDescription()
        {
            var shortDesc = new ShortActionDescription("Capture TFS Build Artifact from ", new Hilite(this.TeamProject));

            var longDesc = new LongActionDescription("using ");

            if (string.IsNullOrEmpty(this.BuildNumber))
            {
                longDesc.AppendContent("the last successful build");
            }
            else
            {
                longDesc.AppendContent("build ", new Hilite(this.BuildNumber));
            }

            longDesc.AppendContent(" of ");

            if (string.IsNullOrEmpty(this.BuildDefinition))
            {
                longDesc.AppendContent("any build definition");
            }
            else
            {
                longDesc.AppendContent("build definition ", new Hilite(this.BuildDefinition));
            }

            longDesc.AppendContent(".");

            return(new ActionDescription(shortDesc, longDesc));
        }
예제 #3
0
        public override ActionDescription GetActionDescription()
        {
            var longDesc = new LongActionDescription();
            if (this.StartupArgs != null && this.StartupArgs.Length > 0)
            {
                longDesc.AppendContent(
                    "with arguments: ",
                    new Hilite(string.Join(" ", this.StartupArgs))
                );
            }

            return new ActionDescription(
                new ShortActionDescription(
                    "Start ",
                    this.ServiceName,
                    " Service"
                ),
                longDesc
            );
        }
        public override ActionDescription GetActionDescription()
        {
            var longDesc = new LongActionDescription();
            if (!string.IsNullOrWhiteSpace(this.Arguments))
            {
                longDesc.AppendContent(
                    "with arguments: ",
                    new Hilite(this.Arguments)
                );
            }

            return new ActionDescription(
                new ShortActionDescription(
                    "Run ",
                    new DirectoryHilite(this.OverriddenSourceDirectory, this.ScriptPath),
                    " using cscript.exe"
                ),
                longDesc
            );
        }
예제 #5
0
        public override ActionDescription GetActionDescription()
        {
            var shortDesc = new ShortActionDescription("Copy ", new Hilite(this.ConfigurationName), " Skytap Environment");

            var longDesc = new LongActionDescription(
                "to ",
                new Hilite(Util.CoalesceStr(this.NewConfigurationName, "new environment"))
                );

            if (this.ExportVariables)
            {
                longDesc.AppendContent(
                    ", and set ${Skytap-EnvironmentId} to the environment ID"
                    );
            }

            return(new ActionDescription(
                       shortDesc,
                       longDesc
                       ));
        }
        public override ActionDescription GetActionDescription()
        {
            var shortDesc = new ShortActionDescription("Capture TFS Build Artifact from ", new Hilite(this.TeamProject));

            var longDesc = new LongActionDescription("using ");
            if (string.IsNullOrEmpty(this.BuildNumber))
                longDesc.AppendContent("the last successful build");
            else
                longDesc.AppendContent("build ", new Hilite(this.BuildNumber));

            longDesc.AppendContent(" of ");

            if (string.IsNullOrEmpty(this.BuildDefinition))
                longDesc.AppendContent("any build definition");
            else
                longDesc.AppendContent("build definition ", new Hilite(this.BuildDefinition));

            longDesc.AppendContent(".");

            return new ActionDescription(shortDesc, longDesc);
        }
예제 #7
0
        public override ActionDescription GetActionDescription()
        {
            var shortDesc = new ShortActionDescription("Publish ", this.ConfigurationName, " Skytap Environment");

            if (!string.IsNullOrEmpty(this.PublishedSetName))
            {
                shortDesc.AppendContent(" to ", new Inedo.BuildMaster.Extensibility.Actions.Hilite(this.PublishedSetName));
            }

            var longDesc = new LongActionDescription("with ");

            if (this.VirtualMachines == null || this.VirtualMachines.Length == 0)
            {
                longDesc.AppendContent(
                    new Inedo.BuildMaster.Extensibility.Actions.Hilite("all"),
                    " virtual machines at ",
                    new Inedo.BuildMaster.Extensibility.Actions.Hilite(this.DefaultAccess)
                    );
            }
            else
            {
                longDesc.AppendContent(
                    new Inedo.BuildMaster.Extensibility.Actions.ListHilite(this.VirtualMachines.Select(v => string.Format("{0} ({1})", v.Name, v.Access)))
                    );
                longDesc.AppendContent(" virtual machines");
            }

            var extraInfo = new List <object>();

            if (!string.IsNullOrEmpty(this.RuntimeLimitHours))
            {
                extraInfo.Add(new object[] { "runtime limit of ", new Inedo.BuildMaster.Extensibility.Actions.Hilite(this.RuntimeLimitHours + " hours") });
            }

            if (!string.IsNullOrEmpty(this.ExpirationHours))
            {
                extraInfo.Add(new object[] { "expiring after ", new Inedo.BuildMaster.Extensibility.Actions.Hilite(this.ExpirationHours + " hours") });
            }

            if (!string.IsNullOrEmpty(this.DailyAccessStart) && !string.IsNullOrEmpty(this.DailyAccessEnd))
            {
                var start = TimeSpan.Parse(this.DailyAccessStart);
                var end   = TimeSpan.Parse(this.DailyAccessEnd);

                var today = DateTime.Today;
                extraInfo.Add(
                    new object[]
                {
                    "daily access from ",
                    new Inedo.BuildMaster.Extensibility.Actions.Hilite((today + start).ToShortTimeString()),
                    " to ",
                    new Inedo.BuildMaster.Extensibility.Actions.Hilite((today + end).ToShortTimeString())
                }
                    );
            }

            if (extraInfo.Count > 0)
            {
                foreach (var info in extraInfo.Take(extraInfo.Count - 1))
                {
                    longDesc.AppendContent(", ", info);
                }

                if (extraInfo.Count > 1)
                {
                    longDesc.AppendContent(", and ", extraInfo.Last());
                }
            }

            return(new ActionDescription(shortDesc, longDesc));
        }