예제 #1
0
        public void Execute()
        {
            var repoList = FileGateway.LoadRepositories();

            FileGateway.SaveMarkdownDirectory(RenderMarkDownDirectory(repoList));
            FileGateway.SaveMarkdownTargets(RenderMarkDownTargets(repoList));
        }
예제 #2
0
        public void Execute()
        {
            var repoList = FileGateway.LoadRepositories();

            RenderMarkDown(repoList);
            FileGateway.SaveMarkdown(RenderMarkDown(repoList));
        }
예제 #3
0
        public async Task ExecuteAsync()
        {
            var repoList  = FileGateway.LoadRepositories();
            var repoIndex = repoList.ToDictionary(q => q.Id, q => q);

            var nukeFile = await GitHubGateway.GetRepositoriesWithNukeFileAsync();

            var nukeBuild = await GitHubGateway.GetRepositoriesWithNukeBuildAsync();

            // Update the RepoList
            foreach (var item in nukeFile.Union(nukeBuild))
            {
                if (!repoIndex.TryGetValue(item.Id, out var repository))
                {
                    repository = new Repository {
                        FirstIndexed = DateTime.Now
                    };
                    repoList.Add(repository);
                    repoIndex[item.Id] = repository;
                }

                UpdateValues(repository, item);
            }

            // Refresh the Repo Details
            var refreshTrigger = DateTime.Now.AddDays(-1);
            var ids            = repoList.Where(q => q.LastDetailUpdated < refreshTrigger).OrderByDescending(q => q.LastDetailUpdated).Select(q => q.Id).ToList();

            foreach (var item in await GitHubGateway.GetRepositoryDetailsAsync(ids))
            {
                if (repoIndex.TryGetValue(item.Id, out var repository))
                {
                    UpdateValues(repository, item);
                }
            }

            // Refresh the Build Files
            refreshTrigger = DateTime.Now.AddDays(-7);
            var refreshRepoList = repoList.Where(q => q.LastBuildFileUpdated < refreshTrigger && !q.Archived).OrderByDescending(q => q.LastBuildFileUpdated).Select(q => (q.Id, q.Owner, q.Name, q.BuildFilePath)).ToList();

            foreach (var item in await GitHubGateway.GetBuildFilesAsync(refreshRepoList))
            {
                if (repoIndex.TryGetValue(item.RepoId, out var repository))
                {
                    UpdateValues(repository, item);
                }
            }

            // Parse content
            foreach (var item in repoList)
            {
                UpdateTargets(item);
            }

            FileGateway.SaveRepositories(repoList);
        }