示例#1
0
        public void CreateOctopusRelease(string projectName, VersionResult version, string apiUrl, string apiKey)
        {
            if (string.IsNullOrEmpty(apiUrl))
            {
                _log.Error("apiUrl canot be empty");
                return;
            }
            if (string.IsNullOrEmpty(apiKey))
            {
                _log.Error("apiKey canot be empty");
                return;
            }
            if (string.IsNullOrEmpty(projectName))
            {
                _log.Error("Project name canot be empty");
                return;
            }
            _log.Information($"Creating octopus release {version.FullVersion}");
            var settings = new CreateReleaseSettings
            {
                EnableDebugLogging    = _log.Verbosity > Verbosity.Normal,
                EnableServiceMessages = false,               // Enables teamcity services messages when logging
                ReleaseNumber         = version.FullVersion,
                DefaultPackageVersion = version.FullVersion, // All packages in the release should be x.x.x.x
                // One or the other
                ReleaseNotes = CommitMessageShort,
                //ReleaseNotesFile = "./ReleaseNotes.md",
                Server = apiUrl,
                ApiKey = apiKey
                         //IgnoreExisting = true // if this release number already exists, ignore it
                         //ToolPath = "./tools/OctopusTools/Octo.exe"
                         //IgnoreSslErrors = true,
                         //Packages = new Dictionary<string, string>
                         //            {
                         //                { "PackageOne", "1.0.2.3" },
                         //                { "PackageTwo", "5.2.3" }
                         //            },
                         //PackagesFolder = @"C:\MyOtherNugetFeed",
            };
            var octoRelease = new OctopusDeployReleaseCreator(_fileSystem, _environment, _processRunner, _tools);

            octoRelease.CreateRelease(projectName, settings);

            if (IsAppVeyor)
            {
                _appVeyorProvider.AddInformationalMessage($"Octopus release {version.FullVersion} created.");
            }
        }
示例#2
0
        protected override void RunTool()
        {
            var tool = new OctopusDeployReleaseCreator(FileSystem, Environment, ProcessRunner, Tools);

            tool.CreateRelease(ProjectName, Settings);
        }
示例#3
0
        public void CreateRelease()
        {
            var tool = new OctopusDeployReleaseCreator(FileSystem, Environment, Globber, ProcessRunner);

            tool.CreateRelease(ProjectName, Settings);
        }