コード例 #1
0
        public async Task <ChannelVersionRuleTestResult> Test(IOctopusAsyncRepository repository, ChannelVersionRuleResource rule, string packageVersion)
        {
            if (rule == null)
            {
                // Anything goes if there is no rule defined for this step
                return(ChannelVersionRuleTestResult.Null());
            }

            var link = repository.Client.RootDocument.Link("VersionRuleTest");

            var resource = new
            {
                version       = packageVersion,
                versionRange  = rule.VersionRange,
                preReleaseTag = rule.Tag
            };

            var response = repository.Client.RootDocument.UsePostForChannelVersionRuleTest()
                ? repository.Client.Post <object, ChannelVersionRuleTestResult>(link, resource)
                : repository.Client.Get <ChannelVersionRuleTestResult>(link, resource);

            return(await response.ConfigureAwait(false));
        }
コード例 #2
0
 public static ChannelVersionRuleTestResult IsSatified(this ChannelVersionRuleTestResult versionRuleTestResult)
 {
     versionRuleTestResult.SatisfiesPreReleaseTag = true;
     versionRuleTestResult.SatisfiesVersionRange  = true;
     return(versionRuleTestResult);
 }
コード例 #3
0
 public void SetChannelVersionRuleTestResult(ChannelVersionRuleTestResult result)
 {
     ChannelVersionRuleTestResult = result;
 }