示例#1
0
        void SetSpaces()
        {
            m_spaces.Clear();
            SpaceComboBox.Items.Clear();
            SpaceComboBox.Items.Add(m_initialSpaceName);

            List <RemoteSpaceSummary> spaces = m_confluenceService.GetSpaces();

            foreach (RemoteSpaceSummary space in spaces)
            {
                m_spaces[space.name] = space;

                if (space.name != m_initialSpaceName)
                {
                    SpaceComboBox.Items.Add(space.name);
                }
            }

            SpaceComboBox.SelectedItem = m_initialSpaceName;
        }
示例#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);
            }
        }