Exemplo n.º 1
0
        public override bool Execute(PublishInput input)
        {
            var report = new PublishReport();

            input.EachSolution(solution =>
            {
                RippleLog.Info("Building nuget files for " + solution.Name);
                var artifactDirectory = solution.Directory.AppendPath(input.ArtifactsFlag);

                RippleLog.Info("Cleaning out any existing nuget files before continuing");
                new FileSystem().CleanDirectory(artifactDirectory);

                solution.Specifications.Each(nuget =>
                {
                    RippleLog.Info("Creating and publishing Nuget for " + nuget.Name);

                    var packageFile = solution.Package(new PackageParams(nuget, SemanticVersion.Parse(input.Version), artifactDirectory, input.CreateSymbolsFlag));
                    var detail      = solution.Publisher.PublishPackage(input.ServerFlag, packageFile, input.ApiKey);

                    report.Add(detail);
                });
            });

            RippleLog.InfoMessage(report);

            if (!report.IsSuccessful())
            {
                RippleAssert.Fail("Failure publishing packages");
            }

            return(true);
        }
Exemplo n.º 2
0
        public override bool Execute(BatchPublishInput input)
        {
            RippleLog.Info("Looking for *.nupkg files in " + input.Directory);

            var files = new FileSystem()
                        .FindFiles(input.Directory, new FileSet {
                Include = "*.nupkg"
            })
                        .ToArray();

            _index = 0;
            _count = files.Count();

            var publisher = PublishingService.Basic();
            var report    = new PublishReport();

            files.Each(file =>
            {
                _index++;
                RippleLog.Info("Trying to publish {0}, {1} or {2}".ToFormat(file, _index, _count));

                var detail = publisher.PublishPackage(input.ServerFlag, file, input.ApiKeyFlag);
                report.Add(detail);
            });

            RippleLog.InfoMessage(report);

            if (!report.IsSuccessful())
            {
                RippleAssert.Fail("Failure publishing packages");
            }

            return(true);
        }