private void UpdateBQ4PerviousBuilds()
        {
            TFVC oTfvc = new TFVC();
            TeamFoundationServer tfs = oTfvc.GetTfs();

            BuildStore bs = (BuildStore)tfs.GetService(typeof(BuildStore));

            BuildData[] bd = bs.GetListOfBuilds(_project, _buildType);

            foreach (BuildData build in bd)
            {
                if (build.BuildQuality.Contains(_buildQuality))
                {
                    bs.UpdateBuildQuality(build.BuildUri, "Rejected");
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Check to see if a build with the same build number foot print (Major.Minor.Fix) is 
        /// already in Production.
        /// </summary>
        /// <param name="_project">The Team project the build is apart of</param>
        /// <param name="_buildType">The build type being built</param>
        /// <param name="_buildNumber">The build number to be created</param>
        /// <returns>
        /// True is returned if a matching Production build number is found
        /// </returns>
        public bool IsBuildInPRD(string _project, string _buildType, string _buildNumber)
        {
            TFVC oTfvc = new TFVC();
            TeamFoundationServer tfs = oTfvc.GetTfs();

            BuildStore bs = (BuildStore)tfs.GetService(typeof(BuildStore));

            foreach (BuildData build in bs.GetListOfBuilds(_project, _buildType))
            {
                if (build.BuildQuality.Equals("In-Production"))
                {
                    if (_buildNumber.Remove(_buildNumber.LastIndexOf(".")).Equals(build.BuildNumber.Remove(build.BuildNumber.LastIndexOf("."))))
                    {
                       return true;
                    }
                }

            }

            return false;
        }
Пример #3
0
 private BuildStore GetBuildStore()
 {
     TFVC oTfvc = new TFVC();
     TeamFoundationServer tfs = oTfvc.GetTfs();
     BuildStore _bs = (BuildStore)tfs.GetService(typeof(BuildStore));
     return (_bs);
 }
Пример #4
0
        public override bool Execute()
        {
            try
            {

                TFVC _Tfvc = new TFVC();
                TeamFoundationServer _tfs = _Tfvc.GetTfs();
                BuildStore _bs = (BuildStore)_tfs.GetService(typeof(BuildStore));
                BuildData _bd = _bs.GetBuildDetails(_buildUri);
                WorkItem _wi = _Tfvc.CreateNewWorkItem(_witype, _dbiProj);
                _wi.Fields["Build Number"].Value = _bn;
                _wi.Fields["HIC Team Build Type"].Value = _bd.BuildType;
                _wi.Fields["HIC Build Requested By"].Value = _bd.RequestedBy;
                _wi.Fields["HIC Team Build Project"].Value = _bd.TeamProject;
                _wi.Title = _bn; // this keep link w/ TFS Deployer

                if (!String.IsNullOrEmpty(_dbiHicProject))
                {
                    _wi.Fields["HIC DBI Project"].Value = _dbiHicProject;
                }

                if (!String.IsNullOrEmpty(_dbiHicSubProject))
                {
                    _wi.Fields["HIC DBI Sub-Project"].Value = _dbiHicSubProject;
                }

                if (!String.IsNullOrEmpty(_dbiType))
                {
                    _wi.Fields["HIC DBI Deployment Type"].Value = _dbiType;
                }
                else
                {
                    _wi.Fields["HIC DBI Deployment Type"].Value = ".Net";
                }

                _wi.Save();

                _wiNumber = _wi.Id;

            }
            catch (Exception _ex)
            {
                string _msg = "Get WorkItem failure:\n" + _ex.Message + "\n" + _ex.StackTrace;
                BuildEngine.LogErrorEvent(new BuildErrorEventArgs("Workitem Failure", "Get Failure",
                                                                  _ex.Source, 0, 0, 0, 0,
                                                                  _msg,
                                                                  "Creating an BBI was unsuccessful",
                                                                  "TFSBuild"));

                return false;
            }

            return true;
        }
Пример #5
0
        public override bool Execute()
        {
            TFVC oTfvc = new TFVC();
            TeamFoundationServer tfs = oTfvc.GetTfs();
            WorkItemStore store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
            WorkItem wi = store.GetWorkItem(_winum);

            wi.Open();
            wi = Update(wi);
            wi.Save();
            return true;
        }