Example #1
0
        public VstsBuildBatchUpdate(DevOpsAccessSetting devOpsAccessSetting, string dbConnectionString, HashSet <string> branches)
        {
            ValidationUtil.ThrowIfNull(devOpsAccessSetting, nameof(devOpsAccessSetting));
            ValidationUtil.ThrowIfNullOrEmptySet(branches, nameof(branches));

            this.devOpsAccessSetting = devOpsAccessSetting;
            this.dbConnectionString  = dbConnectionString;
            this.buildLastUpdatePerBranchPerDefinition = new Dictionary <string, Dictionary <BuildDefinitionId, DateTime> >();
            this.branches = branches;
        }
Example #2
0
        static async Task Main(string[] args)
        {
            var devOpsAccessSetting = new DevOpsAccessSetting("<PAT>");

            try
            {
                var agentManagement      = new AgentManagement(devOpsAccessSetting);
                IList <VstsAgent> agents = await agentManagement.GetAgentsAsync(AgentManagement.IoTEdgeAgentPoolId).ConfigureAwait(false);

                var agentMatrix = new AgentMatrix();
                agentMatrix.Update(agents.Select(IoTEdgeVstsAgent.Create).ToHashSet());
                var unmatchedAgents = agentMatrix.GetUnmatchedAgents();

                var buildManagement = new BuildManagement(devOpsAccessSetting);
                var result          = await buildManagement.GetLatestBuildsAsync(BuildDefinitionExtension.MasterBranchReporting, "refs/heads/master").ConfigureAwait(false);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }