コード例 #1
0
 /// <summary>
 /// Updates the ydr.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="results">The results.</param>
 private static void UpdateYdr(
     BuildControlParameters configuration,
     DailyBuildFullResults results)
 {
     if (configuration.UpdateYdr)
     {
         WpdtOperations.UninstallYdr(configuration);
         WpdtOperations.InstallYdr(configuration, results);
     }
 }
コード例 #2
0
 public void UpdateWpdtOpsForInstalledVersion(BuildControlParameters configuration)
 {
     if (configuration.UpdateWpdt)
     {
         if (WpdtOperations.IsInstalledWpdtVersionSameAsLkg(configuration))
         {
             this.UninstallWdpt.RequestedToRun = false;
             this.InstallWdpt.RequestedToRun   = false;
             this.ModifyWdpt.RequestedToRun    = false;
         }
     }
 }
コード例 #3
0
        /// <summary>
        /// Installs the WDPT.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="results">The results.</param>
        public static void InstallWdpt(
            BuildControlParameters configuration,
            DailyBuildFullResults results)
        {
            ProcessOperations.KillSwanProcesses();
            Console.WriteLine("Starting Wpdt installation ....");
            GeneralFileOperations.WriteProgramStatusFile(ExecutionStatus.InstallWdpt);

            string swanController = Path.Combine(configuration.SwanPath, BuildControlParameters.SwanControllerExeName);
            string swanArguments  = "/f " + Path.Combine(configuration.SwanTestCasePath, configuration.WpdtInstallTestCase);

            Console.WriteLine("SwanController = " + swanController);
            Console.WriteLine("SwanArguments = " + swanArguments);

            ProcessOperations.RunProcess(swanController, configuration.SwanTestCasePath, swanArguments, false);
            Console.WriteLine("Waiting " + configuration.WpdtInstallationTimeMinutes.ToString() +
                              " minutes for install to complete");
            bool wpdtInstalled = false;

            for (Int32 i = 0; i < configuration.WpdtInstallationTimeMinutes; i++)
            {
                for (Int32 j = 0; j < 12; j++)
                {
                    Thread.Sleep(5000);
                    Console.Write(".");
                }
                // Wait one more minute after we detect the product is installed to be sure
                // of any final cleanup required.
                if (wpdtInstalled)
                {
                    break;
                }
                Console.WriteLine("");
                Console.WriteLine("Waited " + (i + 1).ToString() + " minutes");
            }
            wpdtInstalled = IsWpdtInstalled(configuration);
            if (wpdtInstalled)
            {
                results.InstallWdpt.SetResults(true, "");
                Console.WriteLine("Completed Install of Wpdt!");
            }
            else
            {
                results.InstallWdpt.SetResults(false, "Wpdt did not install int the alloted time!");
                Console.WriteLine("Wpdt did not install int the alloted time!");
            }
            ProcessOperations.KillSwanProcesses();
            ProcessOperations.KillSetupProcesses();
            results.WpdtVersion = WpdtOperations.DetermineWdptInstalledVersion(configuration);
            results.YdrVersion  = "Same as Wpdt";
        }
コード例 #4
0
 /// <summary>
 /// WPDTs the ops install.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="results">The results.</param>
 private static void WpdtOpsInstall(
     BuildControlParameters configuration,
     DailyBuildFullResults results)
 {
     if (configuration.UpdateWpdt &&
         !WpdtOperations.IsInstalledWpdtVersionSameAsLkg(configuration))
     {
         WpdtOperations.PrepareWpdtTargetDirectory(configuration, results);
         if (configuration.InstallOnW2k8)
         {
             WpdtOperations.ModifyInstallForW2k8(configuration, results);
         }
         WpdtOperations.InstallWdpt(configuration, results);
     }
 }
コード例 #5
0
        /// <summary>
        /// WPDTs the ops uninstall.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="results">The results.</param>
        private static void WpdtOpsUninstall(
            BuildControlParameters configuration,
            DailyBuildFullResults results)
        {
            ExecutionStatus status = GeneralFileOperations.ReadProgramStatusFile();

            results.WpdtVersion = WpdtOperations.DetermineWdptInstalledVersion(configuration);
            results.YdrVersion  = "Same as Wpdt";
            if (status != ExecutionStatus.UninstallWdpt &&
                configuration.UpdateWpdt)
            {
                if (WpdtOperations.IsWpdtInstalled(configuration))
                {
                    if (!WpdtOperations.IsInstalledWpdtVersionSameAsLkg(configuration))
                    {
                        WpdtOperations.UninstallWdpt(configuration);
                        // Just show some time on the console before we exit
                        for (Int32 i = 0; i < 10; i++)
                        {
                            Console.Write(".");
                            Thread.Sleep(1000);
                        }
                        Console.WriteLine("Exiting process, waiting for Wpdt Uninstall to complete and reboot");
                        // Just show some more time on the console
                        for (Int32 i = 0; i < 10; i++)
                        {
                            Console.Write(".");
                            Thread.Sleep(1000);
                        }
                        Environment.Exit(0);
                    }
                }
                else
                {
                    Console.WriteLine("Requested to Uninstall Wpdt, but it was not installed!");
                    ProgramExecutionLog.AddEntry(
                        "Requested to uninstall Wpdt, but it was not installed");
                }
            }
            if (status == ExecutionStatus.UninstallWdpt)
            {
                results.UninstallWdpt.SetResults(true, "");
                ProcessOperations.KillSwanProcesses();
                Console.WriteLine("Continuing build process after reboot from Wpdt uninstall ...");
                GeneralFileOperations.WriteProgramStatusFile(ExecutionStatus.Running);
            }
        }
コード例 #6
0
        /// <summary>
        /// Creates the build report that gets sent out to [email protected].
        /// </summary>
        public string MakeHeroAppsReport(BuildControlParameters configuration)
        {
            string passTextColor  = "00B050";
            string failTextColor  = "C0504D";
            string blackTextColor = "190707";

            string sourceDir = configuration.ReleaseShareRoot;

            //Gets all log files in the dated directory
            string[] fileEntries = Directory.GetFiles(PublishLogShare, "*.log", SearchOption.AllDirectories);

            string WPDT        = "WPDT";
            string wpdtVersion = string.Format(FormatHtmlStatic(), WPDT, passTextColor, configuration.WpdtLkgSourcePath);

            string YDR        = "YDR Version";
            string ydrVersion = string.Format(FormatHtmlStatic(), YDR, blackTextColor, YdrVersion);

            //Set email body static header
            string emailHeader = "<html xmlns:v=\"urn:schemas-microsoft-com:vml\" " +
                                 "xmlns:o=\"urn:schemas-microsoft-com:office:office\" " +
                                 "xmlns:w=\"urn:schemas-microsoft-com:office:word\" " +
                                 "xmlns:m=\"http://schemas.microsoft.com/office/2004/12/omml\" " +
                                 "xmlns=\"http://www.w3.org/TR/REC-html40\"><head><META HTTP-EQUIV=\"Content-Type\" " +
                                 "CONTENT=\"text/html; charset=us-ascii\"><meta name=Generator content=\"Microsoft Word 14 (filtered medium)\"><style><!--/* Font Definitions */@font-face	{font-family:Calibri;	panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face	{font-family:Tahoma;	panose-1:2 11 6 4 3 5 4 4 2 4;}/* Style Definitions */p.MsoNormal, li.MsoNormal, div.MsoNormal	{margin:0in;	margin-bottom:.0001pt;	font-size:11.0pt;	font-family:\"Calibri\",\"sans-serif\";}a:link, span.MsoHyperlink	{mso-style-priority:99;	color:blue;	text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed	{mso-style-priority:99;	color:purple;	text-decoration:underline;}span.EmailStyle17	{mso-style-type:personal;	font-family:\"Calibri\",\"sans-serif\";	color:windowtext;}span.EmailStyle18	{mso-style-type:personal-reply;	font-family:\"Calibri\",\"sans-serif\";	color:#1F497D;}.MsoChpDefault	{mso-style-type:export-only;	font-size:10.0pt;}@page WordSection1	{size:8.5in 11.0in;	margin:1.0in 1.0in 1.0in 1.0in;}div.WordSection1	{page:WordSection1;}--></style><!--[if gte mso 9]><xml><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\" /></xml><![endif]--><!--[if gte mso 9]><xml><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\" /></o:shapelayout></xml><![endif]--></head>";

            //Build Machine name
            string dailyBuildMachine = "Build Machine";
            string machineName       = System.Environment.MachineName;
            string buildMachine      = string.Format(FormatHtmlStatic(), dailyBuildMachine, blackTextColor, machineName);

            //Set build Location in HTML
            string dailyBuildLocation = "Build Location";
            string buildLocation      = string.Format(FormatHtmlStatic(), dailyBuildLocation, blackTextColor, PublishShare);


            string enlistmentSync  = "";
            string syncdEnlistment = "Enlistment Sync";

            if (configuration.SyncEnlistment)
            {
                if (EnlistmentSync.Success)
                {
                    string enlistmentSuccess = "PASS";
                    enlistmentSync = string.Format(FormatHtmlStatic(), syncdEnlistment, passTextColor, enlistmentSuccess);
                }
                else
                {
                    string enlistmentFail = "FAIL";
                    enlistmentSync = string.Format(FormatHtmlStatic(), syncdEnlistment, failTextColor, enlistmentFail);
                }
            }

            string wpdtStatus = "";
            string wpdtTitle  = "Uninstall and Reinstall of WPDT";

            if (configuration.UpdateWpdt)
            {
                if (WpdtOperations.IsInstalledWpdtVersionSameAsLkg(configuration))
                {
                    string wpdtLkgNoChange = "Machine has current LKG installed";
                    wpdtStatus = string.Format(FormatHtmlStatic(), wpdtTitle, blackTextColor, wpdtLkgNoChange);
                }

                else
                {
                    if (UninstallWdpt.Success && InstallWdpt.Success)
                    {
                        string wpdtUpdateSuccess = "UPDATED";
                        wpdtStatus = string.Format(FormatHtmlStatic(), wpdtTitle, blackTextColor, wpdtUpdateSuccess);
                    }
                    else
                    {
                        string wpdtUpdateFail = "NOT UPDATED";
                        wpdtStatus = string.Format(FormatHtmlStatic(), wpdtTitle, failTextColor, wpdtUpdateFail);
                    }
                }
            }

            //Setup table formatting in HTML
            string tableHeader = "<body lang=EN-US link=blue vlink=purple><div class=WordSection1><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=781 style='width:468.45pt;border-collapse:collapse'><tr><td width=285 style='width:171.2pt;border:solid black 1.0pt;background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal><b><span style='color:#00B0F0'>Hero App<o:p></o:p></span></b></p></td><td width=117 style='width:70.05pt;border:solid black 1.0pt;border-left:none;background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal><b><span style='color:#00B0F0'>Result <o:p></o:p></span></b></p></td><td width=126 valign=top style='width:75.4pt;border:solid black 1.0pt;border-left:none;background:#D9D9D9;padding:0in 0in 0in 0in'><p class=MsoNormal><b><span style='color:#00B0F0'>Sign XAP<o:p></o:p></span></b></p></td><td width=126 valign=top style='width:75.4pt;border:solid black 1.0pt;border-left:none;background:#D9D9D9;padding:0in 0in 0in 0in'><p class=MsoNormal><b><span style='color:#00B0F0'>License XAP<o:p></o:p></span></b></p></td><td width=126 style='width:75.4pt;border-top:solid black 1.0pt;border-left:none;border-bottom:solid black 1.0pt;border-right:none;background:#D9D9D9;padding:0in 0in 0in 0in'><p class=MsoNormal><b><span style='color:#00B0F0'>Logs<o:p></o:p></span></b></p></td>";


            //Sets the static members of the email body
            string completeMailBody = emailHeader + buildMachine + buildLocation + enlistmentSync + wpdtStatus + wpdtVersion + ydrVersion + tableHeader;



            //This is the loop that builds the report. I generates all the information to feed to the email body in HTML
            foreach (BuildTargetResults target in BuildTargets)
            {
                string fileNameString     = target.ProjectTargetName;
                string tempFileNameString = string.Format("<tr><td width=173 style='width:103.75pt;border:solid black 1.0pt;border-top:none;background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal><b>{0}<o:p></o:p></b></p></td>", fileNameString);
                completeMailBody = completeMailBody + tempFileNameString;


                if (target.Build.Success)
                {
                    string pass     = "******";
                    string tempPass = string.Format(FormatHtmlInLoop(), passTextColor, pass);
                    completeMailBody = completeMailBody + tempPass;
                }
                else
                {
                    //App was NOT successfully built.
                    string fail     = "FAIL";
                    string tempFail = string.Format(FormatHtmlInLoop(), failTextColor, fail);
                    completeMailBody = completeMailBody + tempFail;
                }
                if (target.SignXap.Success)
                {
                    //App was signed
                    string xapSignTrue     = "PASS";
                    string tempXapSignTrue = string.Format(FormatHtmlInLoop(), passTextColor, xapSignTrue);
                    completeMailBody = completeMailBody + tempXapSignTrue;
                }
                else
                {
                    string xapSignFalse     = "FAIL";
                    string tempXapSignFalse = string.Format(FormatHtmlInLoop(), failTextColor, xapSignFalse);
                    completeMailBody = completeMailBody + tempXapSignFalse;
                }

                if (target.LicenseXap.Success)
                {
                    //App was signed
                    string xapLicenseTrue     = "PASS";
                    string tempXapLicenseTrue = string.Format(FormatHtmlInLoop(), passTextColor, xapLicenseTrue);
                    completeMailBody = completeMailBody + tempXapLicenseTrue;
                }
                else
                {
                    string xapLicenseFalse  = "FAIL";
                    string tempXapSignFalse = string.Format(FormatHtmlInLoop(), failTextColor, xapLicenseFalse);
                    completeMailBody = completeMailBody + tempXapSignFalse;
                }

                //Sets the log location for all the apps
                string logLocation = string.Format("<td width=76 style='width:45.7pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal><b><a href=\"{0}\">LOG</a><o:p></o:p></b></p></td></tr><tr>",
                                                   PublishLogShare);
                completeMailBody = completeMailBody + logLocation;
            }
            return(completeMailBody);
        }