Exemplo n.º 1
0
        /// <summary>
        /// Add a package to the catalog.
        /// </summary>
        public async Task AddPackageAsync(PackageInput packageInput)
        {
            // Create package details page
            var addFileList = _context.SourceSettings.CatalogEnabled;

            var packageDetails = await CatalogUtility.CreatePackageDetailsAsync(packageInput, CatalogBaseURI, _context.CommitId, addFileList);

            var packageDetailsUri = JsonUtility.GetIdUri(packageDetails);

            // Add output to the package input for other services to use.
            packageInput.PackageDetails = packageDetails;

            var packageDetailsFile = _context.Source.Get(packageDetailsUri);
            await packageDetailsFile.Write(packageDetails, _context.Log, _context.Token);

            // Create commit
            var pageCommit = CatalogUtility.CreatePageCommit(
                packageInput.Identity,
                packageDetailsUri,
                _context.CommitId,
                SleetOperation.Add,
                "nuget:PackageDetails");

            await AddCatalogEntry(pageCommit, "nuget:lastCreated");
        }
Exemplo n.º 2
0
        public async Task AddPackageAsync(PackageInput packageInput)
        {
            // Create package details page
            var packageDetails = await CatalogUtility.CreatePackageDetailsAsync(packageInput, CatalogBaseURI, _context.CommitId, writeFileList : false);

            packageInput.PackageDetails = packageDetails;
        }
Exemplo n.º 3
0
        private async Task CreateDetailsForAdd(PackageInput packageInput)
        {
            // Create a a details page and assign it to the input
            var nupkgUri       = packageInput.GetNupkgUri(_context);
            var packageDetails = await CatalogUtility.CreatePackageDetailsAsync(packageInput, CatalogBaseURI, nupkgUri, _context.CommitId, writeFileList : false);

            packageInput.PackageDetails = packageDetails;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Adds a catalog page and returns the commit.
        /// </summary>
        private async Task <JObject> AddPackageToCatalogAndGetCommit(PackageInput packageInput)
        {
            // Create package details page
            var nupkgUri       = packageInput.GetNupkgUri(_context);
            var packageDetails = await CatalogUtility.CreatePackageDetailsAsync(packageInput, CatalogBaseURI, nupkgUri, _context.CommitId, writeFileList : true);

            var packageDetailsUri = JsonUtility.GetIdUri(packageDetails);

            // Add output to the package input for other services to use.
            packageInput.PackageDetails = packageDetails;

            var packageDetailsFile = _context.Source.Get(packageDetailsUri);
            await packageDetailsFile.Write(packageDetails, _context.Log, _context.Token);

            // Create commit
            return(CatalogUtility.CreatePageCommit(
                       packageInput.Identity,
                       packageDetailsUri,
                       _context.CommitId,
                       SleetOperation.Add,
                       "nuget:PackageDetails"));
        }