Exemplo n.º 1
0
        void SetRootPages(RemoteSpaceSummary space)
        {
            m_pages.Clear();
            RootPageComboBox.Items.Clear();
            RootPageComboBox.Items.Add(m_initialRootPageName);

            if (space != null)
            {
                List <RemotePageSummary> pages = m_confluenceService.GetPages(space.key);
                foreach (RemotePageSummary page in pages)
                {
                    m_pages[page.title] = page;

                    if (page.title != m_initialRootPageName)
                    {
                        RootPageComboBox.Items.Add(page.title);
                    }
                }
            }

            RootPageComboBox.SelectedItem = m_initialRootPageName;
        }
Exemplo n.º 2
0
        static void UploadStatsPages(ConfluenceService confluence, LogData logData, string[] groups, string spaceName, string rootPageName, string platformPageName, string buildPageName, XmlNodeList metrics, bool uploadSummary, string logfile)
        {
            try
            {
                List <ConfluenceSOAP.RemoteSpaceSummary> spaces = confluence.GetSpaces();

                bool spaceExists        = false;
                bool rootPageExists     = false;
                bool platformPageExists = false;
                bool buildPageExists    = false;

                foreach (ConfluenceSOAP.RemoteSpaceSummary space in spaces)
                {
                    if (space.key == spaceName)
                    {
                        spaceExists = true;
                        break;
                    }
                }

                if (!spaceExists)
                {
                    confluence.CreateSpace(spaceName);
                }

                List <ConfluenceSOAP.RemotePageSummary> pages = confluence.GetPages(spaceName);

                foreach (ConfluenceSOAP.RemotePageSummary page in pages)
                {
                    if (page.title == rootPageName)
                    {
                        rootPageExists = true;
                    }

                    if (page.title == platformPageName)
                    {
                        platformPageExists = true;
                    }

                    if (page.title == buildPageName)
                    {
                        buildPageExists = true;
                    }
                }

                if (!rootPageExists)
                {
                    confluence.CreatePage(rootPageName, spaceName);
                }

                if (!platformPageExists)
                {
                    confluence.CreatePage(platformPageName, rootPageName, spaceName);
                }

                if (!buildPageExists)
                {
                    confluence.CreatePage(buildPageName, platformPageName, spaceName);
                }

                string timeDateString = DateTime.Now.ToString("dd/MM/yy hh:mm:ss \\(\\U\\T\\Cz\\)");

                ConfluenceService.PageContentMetaData pageContentMD = new ConfluenceService.PageContentMetaData(timeDateString, logData.Name, logData.BuildInfo.PlatformString, logData.BuildInfo.BuildNumberString, "", confluence.m_username, "automated build system", false);
                ConfluenceService.PageMetaData        pageMetaData  = new ConfluenceService.PageMetaData(spaceName, buildPageName, platformPageName, pageContentMD);
                confluence.UploadStatsDataPage(pageMetaData, logData, groups, metrics, uploadSummary);

                foreach (FrameRecordRange frr in logData.LevelRanges)
                {
                    LogData levelLogData = new LogData(logData, frr);
                    pageContentMD.m_levelName = levelLogData.Name;
                    ConfluenceService.PageMetaData levelPageMD = new ConfluenceService.PageMetaData(spaceName, levelLogData.Name + " - " + buildPageName, buildPageName, pageContentMD);
                    confluence.UploadStatsDataPage(levelPageMD, levelLogData, groups, metrics, true);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Something went wrong! :(\n\n" + ex.ToString() + Environment.NewLine + "Stack trace: " + ex.StackTrace);
                System.Environment.Exit(3);
            }
        }