public CollectSectionsFacts() { var root = GetRepoRootWithoutDotGit(); _repo = GitFileSystemRoot.DiscoverRepo(root); var git = new GitFileSystemRoot(_repo); _catalog = new Catalog(); var site = new SiteDefinition { Title = "Run pipeline", OutputPath = "output", BuildPath = "_build", Branches = new Dictionary <string, BranchDefinition> { ["HEAD"] = new BranchDefinition() { InputPath = new[] { "docs-v2", "ui-bundle" } } } }; _aggregator = new ContentAggregator( site, git, new PhysicalFileSystem(root), new MimeDbClassifier()); }
public async Task Execute(CancellationToken cancellationToken = default) { using var _ = _logger.BeginScope(nameof(Execute)); _logger.LogInformation("Executing pipeline"); await CacheFileSystem.DeleteDir("content"); await CacheFileSystem.GetOrCreateDirectory("content"); await CacheFileSystem.DeleteDir("content-html"); await CacheFileSystem.GetOrCreateDirectory("content-html"); var outputPath = GetRootedPath(CurrentPath, Site.OutputPath); await FileSystem.CleanDirectory(outputPath); await FileSystem.GetOrCreateDirectory(outputPath); RawCache = await CacheFileSystem.Mount("content"); PageCache = await CacheFileSystem.Mount("content-html"); OutputFs = await FileSystem.Mount(outputPath); /* Aggregate content based on branches, tags and etc given in site definition */ var aggregator = new ContentAggregator( Site, GitRoot, FileSystem, new MimeDbClassifier()); var catalog = new Catalog(); /* Add content */ await catalog.Add(aggregator.Aggregate(cancellationToken), cancellationToken); /* Site */ var site = await BuildSite(catalog, Site); /* UI */ var ui = new UiBuilder(PageCache, OutputFs); await ui.BuildSite(site); _logger.LogInformation("Pipeline completed"); }