public CreateReleaseCommand(IOctopusRepositoryFactory repositoryFactory, ILog log, IPackageVersionResolver versionResolver) : base(repositoryFactory, log) { this.versionResolver = versionResolver; DeployToEnvironmentNames = new List<string>(); DeploymentStatusCheckSleepCycle = TimeSpan.FromSeconds(10); DeploymentTimeout = TimeSpan.FromMinutes(10); var options = Options.For("Release creation"); options.Add("project=", "Name of the project", v => ProjectName = v); options.Add("channel=", "[Optional] Channel to use for the new release.", v => ChannelName = v); options.Add("version=|releaseNumber=", "[Optional] Release number to use for the new release.", v => VersionNumber = v); options.Add("packageversion=|defaultpackageversion=", "Default version number of all packages to use for this release.", v => versionResolver.Default(v)); options.Add("package=", "[Optional] Version number to use for a package in the release. Format: --package={StepName}:{Version}", v => versionResolver.Add(v)); options.Add("packagesFolder=", "[Optional] A folder containing NuGet packages from which we should get versions.", v => versionResolver.AddFolder(v)); options.Add("releasenotes=", "[Optional] Release Notes for the new release.", v => ReleaseNotes = v); options.Add("releasenotesfile=", "[Optional] Path to a file that contains Release Notes for the new release.", ReadReleaseNotesFromFile); options.Add("ignoreexisting", "If a release with the version number already exists, ignore it", v => IgnoreIfAlreadyExists = true); options.Add("ignorechannelrules", "[Optional] Ignore package version matching rules", v => Force = true); options.Add("packageprerelease=", "[Optional] Pre-release for latest version of all packages to use for this release.", v => VersionPrerelease = v); options = Options.For("Deployment"); options.Add("deployto=", "[Optional] Environment to automatically deploy to, e.g., Production", v => DeployToEnvironmentNames.Add(v)); }
public CreateReleaseCommand(IOctopusRepositoryFactory repositoryFactory, ILog log, IPackageVersionResolver versionResolver) : base(repositoryFactory, log) { this.versionResolver = versionResolver; DeployToEnvironmentNames = new List <string>(); DeploymentStatusCheckSleepCycle = TimeSpan.FromSeconds(10); DeploymentTimeout = TimeSpan.FromMinutes(10); var options = Options.For("Release creation"); options.Add("project=", "Name of the project", v => ProjectName = v); options.Add("channel=", "[Optional] Channel to use for the new release.", v => ChannelName = v); options.Add("version=|releaseNumber=", "[Optional] Release number to use for the new release.", v => VersionNumber = v); options.Add("packageversion=|defaultpackageversion=", "Default version number of all packages to use for this release.", v => versionResolver.Default(v)); options.Add("package=", "[Optional] Version number to use for a package in the release. Format: --package={StepName}:{Version}", v => versionResolver.Add(v)); options.Add("packagesFolder=", "[Optional] A folder containing NuGet packages from which we should get versions.", v => versionResolver.AddFolder(v)); options.Add("releasenotes=", "[Optional] Release Notes for the new release.", v => ReleaseNotes = v); options.Add("releasenotesfile=", "[Optional] Path to a file that contains Release Notes for the new release.", ReadReleaseNotesFromFile); options.Add("ignoreexisting", "If a release with the version number already exists, ignore it", v => IgnoreIfAlreadyExists = true); options.Add("ignorechannelrules", "[Optional] Ignore package version matching rules", v => Force = true); options.Add("packageprerelease=", "[Optional] Pre-release for latest version of all packages to use for this release.", v => VersionPrerelease = v); options = Options.For("Deployment"); options.Add("deployto=", "[Optional] Environment to automatically deploy to, e.g., Production", v => DeployToEnvironmentNames.Add(v)); }
internal DependencyScanner(InMemoryIndex index, Config config, IFileAccess fileSystem, PackagePolicies packagePolicies) { this.versionResolver = new PackageVersionResolver(index); this.registry = new NuGetDependencies(index, config); this.fileSystem = fileSystem; this.packagePolicies = packagePolicies; this.followLocations = config.FollowLocations; }
public CreateReleaseCommand(IOctopusRepositoryFactory repositoryFactory, ILog log, IPackageVersionResolver versionResolver) : base(repositoryFactory, log) { this.versionResolver = versionResolver; DeployToEnvironmentNames = new List<string>(); DeploymentStatusCheckSleepCycle = TimeSpan.FromSeconds(10); DeploymentTimeout = TimeSpan.FromMinutes(10); }
public ReleasePlan(IEnumerable <Step> steps, IPackageVersionResolver versionResolver) { this.steps = steps.Select(delegate(Step s) { var version = versionResolver.ResolveVersion(s.ToString()) ?? versionResolver.ResolveVersion(s.NuGetPackageId); return(new ReleasePlanItem(s, version)); }).ToList(); }
public ReleasePlan(IEnumerable<Step> steps, IPackageVersionResolver versionResolver) { this.steps = steps.Select(delegate(Step s) { var version = versionResolver.ResolveVersion(s.ToString()) ?? versionResolver.ResolveVersion(s.NuGetPackageId); return new ReleasePlanItem(s, version); }).ToList(); }
public CreateReleaseCommand(IOctopusRepositoryFactory repositoryFactory, ILog log, IPackageVersionResolver versionResolver) : base(repositoryFactory, log) { this.versionResolver = versionResolver; DeployToEnvironmentNames = new List <string>(); DeploymentStatusCheckSleepCycle = TimeSpan.FromSeconds(10); DeploymentTimeout = TimeSpan.FromMinutes(10); }
public NuGetDependencies(InMemoryIndex index, Config config) { this.index = index; this.config = config.DiskCache; this.ignoreDuplicatePackages = config.IgnoreDuplicatePackages; this.versionResolver = new PackageVersionResolver(index); this.detailsPathFormatStr = Path.Combine(this.config.CacheRoot, "packageDetails", "{0}_{1}.json"); this.resolvedPathFormatStr = Path.Combine(this.config.CacheRoot, "resolvedDependencies", "{0}_{1}.json"); this.packagePolicies = PackagePolicies.LoadFrom(config.PackagePolicies); }
public CreateReleaseCommand(IOctopusSessionFactory session, ILog log, IDeploymentWatcher deploymentWatcher, IPackageVersionResolver versionResolver) : base(session, log) { this.deploymentWatcher = deploymentWatcher; this.versionResolver = versionResolver; DeployToEnvironmentNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase); DeploymentStatusCheckSleepCycle = TimeSpan.FromSeconds(10); DeploymentTimeout = TimeSpan.FromMinutes(10); }
public CreateReleaseCommand(IOctopusSessionFactory session, ILog log, IDeploymentWatcher deploymentWatcher, IPackageVersionResolver versionResolver) : base(session, log) { this.deploymentWatcher = deploymentWatcher; this.versionResolver = versionResolver; DeployToEnvironmentNames = new HashSet <string>(StringComparer.OrdinalIgnoreCase); DeploymentStatusCheckSleepCycle = TimeSpan.FromSeconds(10); DeploymentTimeout = TimeSpan.FromMinutes(10); }
public DependencyScanner(INpm npm, IFileAccess fileSystem, PackagePolicies packagePolicies, DiskCacheConfig config) { this.fileSystem = fileSystem; this.npm = npm; this.versionResolver = new NpmVersionResolver(npm, config); this.packagePolicies = packagePolicies; this.config = config; this.detailsPathFormatStr = Path.Combine(this.config.CacheRoot, "packageDetails", "{0}_{1}.json"); this.resolvedPathFormatStr = Path.Combine(this.config.CacheRoot, "resolvedDependencies", "{0}_{1}.json"); }
public ReleasePlan(ReleaseTemplateResource releaseTemplate, IPackageVersionResolver versionResolver) { steps.AddRange( releaseTemplate.Packages.Select(p => new ReleasePlanItem( p.StepName, p.NuGetPackageId, p.NuGetFeedId, p.IsResolvable, versionResolver.ResolveVersion(p.StepName) ?? versionResolver.ResolveVersion(p.NuGetPackageId) )) ); }
public ReleasePlan(ProjectResource project, ChannelResource channel, ReleaseTemplateResource releaseTemplate, IPackageVersionResolver versionResolver) { Project = project; Channel = channel; ReleaseTemplate = releaseTemplate; steps = releaseTemplate.Packages.Select( p => new ReleasePlanItem( p.StepName, p.PackageId, p.FeedId, p.IsResolvable, versionResolver.ResolveVersion(p.StepName) ?? versionResolver.ResolveVersion(p.PackageId))) .ToArray(); }
public CreateReleaseCommand(IOctopusAsyncRepositoryFactory repositoryFactory, IOctopusFileSystem fileSystem, IPackageVersionResolver versionResolver, IReleasePlanBuilder releasePlanBuilder, IOctopusClientFactory clientFactory, ICommandOutputProvider commandOutputProvider, ExecutionResourceWaiter.Factory executionResourceWaiterFactory) : base(repositoryFactory, fileSystem, clientFactory, commandOutputProvider, executionResourceWaiterFactory) { this.releasePlanBuilder = releasePlanBuilder; var options = Options.For("Release creation"); options.Add <string>("project=", "Name or ID of the project.", v => ProjectNameOrId = v); options.Add <string>("defaultPackageVersion=|packageVersion=", "Default version number of all packages to use for this release. Override per-package using --package.", versionResolver.Default); options.Add <string>("ref=|gitRef=", "[Optional, Experimental] Git reference to use when creating the release.", v => GitReference = v); options.Add <string>("version=|releaseNumber=", "[Optional] Release number to use for the new release.", v => VersionNumber = v); options.Add <string>("channel=", "[Optional] Name or ID of the channel to use for the new release. Omit this argument to automatically select the best channel.", v => ChannelNameOrId = v); options.Add <string>("package=", "[Optional] Version number to use for a package in the release. Format: StepName:Version or PackageID:Version or StepName:PackageName:Version. StepName, PackageID, and PackageName can be replaced with an asterisk. An asterisk will be assumed for StepName, PackageID, or PackageName if they are omitted.", v => versionResolver.Add(v), allowsMultiple: true); options.Add <string>("packagesFolder=", "[Optional] A folder containing NuGet packages from which we should get versions.", v => { v.CheckForIllegalPathCharacters("packagesFolder"); versionResolver.AddFolder(v); }, allowsMultiple: true); options.Add <string>("releaseNotes=", "[Optional] Release Notes for the new release. Styling with Markdown is supported.", v => ReleaseNotes = v); options.Add <string>("releaseNoteFile=|releaseNotesFile=", "[Optional] Path to a file that contains Release Notes for the new release. Supports Markdown files.", ReadReleaseNotesFromFile); options.Add <bool>("ignoreExisting", "[Optional, Flag] Don't create this release if there is already one with the same version number.", v => IgnoreIfAlreadyExists = true); options.Add <bool>("ignoreChannelRules", "[Optional, Flag] Create the release ignoring any version rules specified by the channel.", v => IgnoreChannelRules = true); options.Add <string>("packagePrerelease=", "[Optional] Pre-release for latest version of all packages to use for this release.", v => VersionPreReleaseTag = v); options.Add <bool>("whatIf", "[Optional, Flag] Perform a dry run but don't actually create/deploy release.", v => WhatIf = true); options = Options.For("Deployment"); options.Add <string>("deployTo=", "[Optional] Name or ID of the environment to automatically deploy to, e.g., 'Production' or 'Environments-1'; specify this argument multiple times to deploy to multiple environments.", v => DeployToEnvironmentNamesOrIds.Add(v), allowsMultiple: true); }
public CreateReleaseCommand(IOctopusAsyncRepositoryFactory repositoryFactory, ILogger log, IOctopusFileSystem fileSystem, IPackageVersionResolver versionResolver, IReleasePlanBuilder releasePlanBuilder, IOctopusClientFactory clientFactory) : base(repositoryFactory, log, fileSystem, clientFactory) { this.releasePlanBuilder = releasePlanBuilder; DeploymentStatusCheckSleepCycle = TimeSpan.FromSeconds(10); DeploymentTimeout = TimeSpan.FromMinutes(10); var options = Options.For("Release creation"); options.Add("project=", "Name of the project", v => ProjectName = v); options.Add("defaultpackageversion=|packageversion=", "Default version number of all packages to use for this release. Override per-package using --package.", versionResolver.Default); options.Add("version=|releaseNumber=", "[Optional] Release number to use for the new release.", v => VersionNumber = v); options.Add("channel=", "[Optional] Channel to use for the new release. Omit this argument to automatically select the best channel.", v => ChannelName = v); options.Add("package=", "[Optional] Version number to use for a package in the release. Format: --package={StepName}:{Version}", v => versionResolver.Add(v)); options.Add("packagesFolder=", "[Optional] A folder containing NuGet packages from which we should get versions.", v => versionResolver.AddFolder(v)); options.Add("releasenotes=", "[Optional] Release Notes for the new release.", v => ReleaseNotes = v); options.Add("releasenotesfile=", "[Optional] Path to a file that contains Release Notes for the new release.", ReadReleaseNotesFromFile); options.Add("ignoreexisting", "[Optional, Flag] Don't create this release if there is already one with the same version number.", v => IgnoreIfAlreadyExists = true); options.Add("ignorechannelrules", "[Optional, Flag] Create the release ignoring any version rules specified by the channel.", v => IgnoreChannelRules = true); options.Add("packageprerelease=", "[Optional] Pre-release for latest version of all packages to use for this release.", v => VersionPreReleaseTag = v); options.Add("whatif", "[Optional, Flag] Perform a dry run but don't actually create/deploy release.", v => WhatIf = true); options = Options.For("Deployment"); options.Add("deployto=", "[Optional] Environment to automatically deploy to, e.g., Production", v => DeployToEnvironmentNames.Add(v)); }
public void SetUp() { versionResolver = Substitute.For<IPackageVersionResolver>(); }
public void SetUp() { versionResolver = Substitute.For <IPackageVersionResolver>(); }
public void SetUp() { versionResolver = Substitute.For <IPackageVersionResolver>(); releasePlanBuilder = Substitute.For <IReleasePlanBuilder>(); }
public ReleasePlanBuilder(ILogger log, IPackageVersionResolver versionResolver, IChannelVersionRuleTester versionRuleTester) { this.log = log; this.versionResolver = versionResolver; this.versionRuleTester = versionRuleTester; }
public ReleasePlan(ProjectResource project, ChannelResource channel, ReleaseTemplateResource releaseTemplate, IPackageVersionResolver versionResolver) { Project = project; Channel = channel; ReleaseTemplate = releaseTemplate; steps = releaseTemplate.Packages.Select( p => new ReleasePlanItem( p.StepName, p.PackageId, p.FeedId, p.IsResolvable, versionResolver.ResolveVersion(p.StepName, p.PackageId))) .ToArray(); }
public CreateReleaseCommand(IOctopusAsyncRepositoryFactory repositoryFactory, IOctopusFileSystem fileSystem, IPackageVersionResolver versionResolver, IReleasePlanBuilder releasePlanBuilder, IOctopusClientFactory clientFactory, ICommandOutputProvider commandOutputProvider) : base(repositoryFactory, fileSystem, clientFactory, commandOutputProvider) { this.releasePlanBuilder = releasePlanBuilder; var options = Options.For("Release creation"); options.Add("project=", "Name or ID of the project", v => ProjectNameOrId = v); options.Add("defaultpackageversion=|packageversion=", "Default version number of all packages to use for this release. Override per-package using --package.", versionResolver.Default); options.Add("version=|releaseNumber=", "[Optional] Release number to use for the new release.", v => VersionNumber = v); options.Add("channel=", "[Optional] Name or ID of the channel to use for the new release. Omit this argument to automatically select the best channel.", v => ChannelNameOrId = v); options.Add("package=", "[Optional] Version number to use for a package in the release. Format: StepName:Version or PackageID:Version or StepName:PackageName:Version. StepName, PackageID, and PackageName can be replaced with an asterisk.", v => versionResolver.Add(v)); options.Add("packagesFolder=", "[Optional] A folder containing NuGet packages from which we should get versions.", v => { v.CheckForIllegalPathCharacters("packagesFolder"); versionResolver.AddFolder(v); }); options.Add("releasenotes=", "[Optional] Release Notes for the new release. Styling with Markdown is supported.", v => ReleaseNotes = v); options.Add("releasenotesfile=", "[Optional] Path to a file that contains Release Notes for the new release. Supports Markdown files.", ReadReleaseNotesFromFile); options.Add("ignoreexisting", "[Optional, Flag] Don't create this release if there is already one with the same version number.", v => IgnoreIfAlreadyExists = true); options.Add("ignorechannelrules", "[Optional, Flag] Create the release ignoring any version rules specified by the channel.", v => IgnoreChannelRules = true); options.Add("packageprerelease=", "[Optional] Pre-release for latest version of all packages to use for this release.", v => VersionPreReleaseTag = v); options.Add("packageprereleasefallbacks=", "[Optional] Comma-separated pre-release fallback tags, evaluate sequentally until first match. In case of regular packageprerelease does not match.", v => versionPreReleaseTagFallBacks = v); options.Add("softdefaultpackageversion=", "[Optional]Default version number of all packages to use for this release. If this package with this version does not exists, --packageprerelease and --packageprereleasefallbacks heuristics will be used ", v => softDefaultPackageVersion = v); options.Add("latestbypublishdate=", "[Optional, Flag] Choose the latest published packages instead of packages with the biggest SemVer. Flag has no effect to release packages(without prerelease tag).", v => LatestByPublishDate = true); options.Add("whatif", "[Optional, Flag] Perform a dry run but don't actually create/deploy release.", v => WhatIf = true); options = Options.For("Deployment"); options.Add("deployto=", "[Optional] Name or ID of the environment to automatically deploy to, e.g., 'Production' or 'Environments-1'; specify this argument multiple times to deploy to multiple environments.", v => DeployToEnvironmentNamesOrIds.Add(v)); }
public ReleasePlanBuilder(ILogger log, IPackageVersionResolver versionResolver, IChannelVersionRuleTester versionRuleTester, ICommandOutputProvider commandOutputProvider) { this.versionResolver = versionResolver; this.versionRuleTester = versionRuleTester; this.commandOutputProvider = commandOutputProvider; }
public void SetUp() { versionResolver = Substitute.For<IPackageVersionResolver>(); releasePlanBuilder = Substitute.For<IReleasePlanBuilder>(); }
public void Setup() { // setup data objects channelVersionRules = new List <ChannelVersionRuleResource>(); projectResource = new ProjectResource { DeploymentProcessId = TestHelpers.GetId("deploymentprocess"), Id = TestHelpers.GetId("project") }; deploymentProcessResource = new DeploymentProcessResource { ProjectId = projectResource.Id, Id = projectResource.DeploymentProcessId }; releaseTemplateResource = new ReleaseTemplateResource { DeploymentProcessId = projectResource.DeploymentProcessId, Packages = new List <ReleaseTemplatePackage>(), Id = TestHelpers.GetId("releaseTemplate") }; channelResource = new ChannelResource { IsDefault = true, Id = TestHelpers.GetId("channel"), ProjectId = projectResource.Id, Rules = channelVersionRules, Name = TestHelpers.GetId("channelname") }; feedResource = new FeedResource { Id = BuiltInFeedId, Name = "Built in feed", Links = new LinkCollection { { "SearchTemplate", TestHelpers.GetId("searchUri") } } }; // setup mocks logger = Substitute.For <ILogger>(); versionResolver = Substitute.For <IPackageVersionResolver>(); versionRuleTester = Substitute.For <IChannelVersionRuleTester>(); commandOutputProvider = Substitute.For <ICommandOutputProvider>(); deploymentProcessRepository = Substitute.For <IDeploymentProcessRepository>(); deploymentProcessRepository.Get(projectResource.DeploymentProcessId) .Returns(Task.FromResult(deploymentProcessResource)); deploymentProcessRepository .GetTemplate(Arg.Is(deploymentProcessResource), Arg.Is(channelResource)) .Returns(Task.FromResult(releaseTemplateResource)); versionRuleTester .Test(Arg.Any <IOctopusAsyncRepository>(), Arg.Any <ChannelVersionRuleResource>(), Arg.Any <string>(), Arg.Any <string>()) .Returns(Task.FromResult(channelVersionRuleTestResult)); deploymentProcessRepositoryBeta = Substitute.For <IDeploymentProcessRepositoryBeta>(); deploymentProcessRepositoryBeta.Get(projectResource, Arg.Any <string>()) .Returns(Task.FromResult(deploymentProcessResource)); var feeds = new List <FeedResource> { feedResource }; releaseRepository = Substitute.For <IReleaseRepository>(); feedRepository = Substitute.For <IFeedRepository>(); feedRepository.Get(Arg.Any <string[]>()).Returns(feeds); feedRepository.FindByNames(Arg.Any <IEnumerable <string> >()).Returns(feeds); repository = Substitute.For <IOctopusAsyncRepository>(); repository.DeploymentProcesses.Returns(deploymentProcessRepository); repository.DeploymentProcesses.Beta().Returns(deploymentProcessRepositoryBeta); repository.Releases.Returns(releaseRepository); repository.Feeds.Returns(feedRepository); repository.Client .Get <List <PackageResource> >(Arg.Any <string>(), Arg.Any <IDictionary <string, object> >()) .Returns(packages); builder = new ReleasePlanBuilder(logger, versionResolver, versionRuleTester, commandOutputProvider); gitReference = null; }
public CreateReleaseCommand(IOctopusRepositoryFactory repositoryFactory, ILogger log, IOctopusFileSystem fileSystem, IPackageVersionResolver versionResolver, IReleasePlanBuilder releasePlanBuilder) : base(repositoryFactory, log, fileSystem) { this.releasePlanBuilder = releasePlanBuilder; DeploymentStatusCheckSleepCycle = TimeSpan.FromSeconds(10); DeploymentTimeout = TimeSpan.FromMinutes(10); var options = Options.For("Release creation"); options.Add("project=", "Name of the project", v => ProjectName = v); options.Add("defaultpackageversion=|packageversion=", "Default version number of all packages to use for this release. Override per-package using --package.", versionResolver.Default); options.Add("version=|releaseNumber=", "[Optional] Release number to use for the new release.", v => VersionNumber = v); options.Add("channel=", "[Optional] Channel to use for the new release. Omit this argument to automatically select the best channel.", v => ChannelName = v); options.Add("package=", "[Optional] Version number to use for a package in the release. Format: --package={StepName}:{Version}", v => versionResolver.Add(v)); options.Add("packagesFolder=", "[Optional] A folder containing NuGet packages from which we should get versions.", v => versionResolver.AddFolder(v)); options.Add("releasenotes=", "[Optional] Release Notes for the new release.", v => ReleaseNotes = v); options.Add("releasenotesfile=", "[Optional] Path to a file that contains Release Notes for the new release.", ReadReleaseNotesFromFile); options.Add("ignoreexisting", "[Optional, Flag] Don't create this release if there is already one with the same version number.", v => IgnoreIfAlreadyExists = true); options.Add("ignorechannelrules", "[Optional, Flag] Create the release ignoring any version rules specified by the channel.", v => IgnoreChannelRules = true); options.Add("packageprerelease=", "[Optional] Pre-release for latest version of all packages to use for this release.", v => VersionPreReleaseTag = v); options.Add("whatif", "[Optional, Flag] Perform a dry run but don't actually create/deploy release.", v => WhatIf = true); options = Options.For("Deployment"); options.Add("deployto=", "[Optional] Environment to automatically deploy to, e.g., Production", v => DeployToEnvironmentNames.Add(v)); }