├── version.txt
├── .octopus
├── schema_version.ocl
├── deployment_settings.ocl
└── channels.ocl
├── BuildAssets
├── octo.cmd
├── icon.png
├── OctoWrapper.sh
├── init.ps1
├── VERIFICATION.txt
├── LICENSE.txt
├── octo
├── OctopusTools.nuspec
├── repos
│ ├── README.md
│ ├── test-linux-package-from-feed-in-dists.sh
│ └── test-linux-package-from-feed.sh
├── test-linux-package.sh
└── create-octopuscli-linux-packages.sh
├── .github
├── CODEOWNERS
├── workflows
│ ├── release.yml
│ └── codeql-analysis.yml
├── ISSUE_TEMPLATE.md
└── CONTRIBUTING.md
├── source
├── Octo
│ ├── runtimeconfig.template.json
│ ├── Properties
│ │ ├── Icon.ico
│ │ └── AssemblyInfo.cs
│ ├── init.ps1
│ ├── Program.cs
│ └── Octo.csproj
├── Octopus.Cli
│ ├── icon.png
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Model
│ │ ├── DeploymentRelatedResources.cs
│ │ ├── ProjectExport.cs
│ │ └── ChannelVersionRuleTestResult.cs
│ ├── Util
│ │ ├── LazyExtensions.cs
│ │ ├── CommandOutputJsonSerializer.cs
│ │ ├── AssemblyExtensions.cs
│ │ ├── NumericExtensions.cs
│ │ ├── UriExtensions.cs
│ │ ├── StringExtensions.cs
│ │ ├── FeedCustomExpressionHelper.cs
│ │ ├── ReplaceStatus.cs
│ │ ├── ListExtensions.cs
│ │ ├── LineSplitter.cs
│ │ ├── DeletionOptions.cs
│ │ ├── IOctopusFileSystem.cs
│ │ ├── FeatureDetectionExtensions.cs
│ │ ├── Humanize.cs
│ │ ├── ResourceCollectionExtensions.cs
│ │ ├── SerilogLogProvider.cs
│ │ └── CommandSuggester.cs
│ ├── Diagnostics
│ │ ├── LoggingModule.cs
│ │ └── LogUtilities.cs
│ ├── Commands
│ │ ├── Releases
│ │ │ ├── IChannelVersionRuleTester.cs
│ │ │ ├── IReleasePlanBuilder.cs
│ │ │ ├── ChannelVersionRuleTester.cs
│ │ │ ├── ReleasePlanItem.cs
│ │ │ ├── IPackageVersionResolver.cs
│ │ │ ├── AllowReleaseProgressionCommand.cs
│ │ │ ├── ListReleasesCommand.cs
│ │ │ └── PreventReleaseProgressionCommand.cs
│ │ ├── ExportCommand.cs
│ │ ├── Package
│ │ │ ├── IPackageBuilder.cs
│ │ │ ├── NuGetPackageBuilder.cs
│ │ │ ├── DeletePackageCommand.cs
│ │ │ ├── BuildInformationCommand.cs
│ │ │ ├── PushMetadataCommand.cs
│ │ │ └── PushCommand.cs
│ │ ├── VersionCommand.cs
│ │ ├── ImportCommand.cs
│ │ ├── WorkerPool
│ │ │ ├── ListWorkerPoolsCommand.cs
│ │ │ └── CreateWorkerPoolCommand.cs
│ │ ├── Project
│ │ │ ├── ListProjectsCommand.cs
│ │ │ ├── DeleteProjectCommand.cs
│ │ │ ├── DisableProjectCommand.cs
│ │ │ └── CreateProjectCommand.cs
│ │ ├── Environment
│ │ │ ├── ListEnvironmentsCommand.cs
│ │ │ └── CreateEnvironmentCommand.cs
│ │ ├── Tenant
│ │ │ └── ListTenantsCommand.cs
│ │ └── HealthStatusProvider.cs
│ ├── Repositories
│ │ ├── IActionTemplateRepository.cs
│ │ ├── OctopusRepositoryFactory.cs
│ │ └── ActionTemplateRepository.cs
│ ├── Extensions
│ │ ├── AttributeExtensions.cs
│ │ └── TimeSpanExtensions.cs
│ ├── Infrastructure
│ │ ├── AutofacExtensions.cs
│ │ └── CouldNotFindException.cs
│ └── Octopus.Cli.csproj
├── Octopus.DotNet.Cli
│ ├── icon.png
│ ├── Program.cs
│ └── Octopus.DotNet.Cli.csproj
├── Octo.Tests
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Commands
│ │ ├── Resources
│ │ │ └── CreateRelease.config.txt
│ │ ├── ListReleasesCommandFixture.ShouldGetListOfReleases.approved.txt
│ │ ├── ListReleasesCommandFixture.JsonFormat_ShouldBeWellFormed.approved.txt
│ │ ├── VersionTestFixture.cs
│ │ ├── ListWorkerPoolsCommandFixture.cs
│ │ ├── ListEnvironmentsCommandFixture.cs
│ │ ├── DummyApiCommand.cs
│ │ ├── ListProjectsCommandFixture.cs
│ │ ├── CreateWorkerPoolCommandFixture.cs
│ │ ├── ListTenantsFixtures.cs
│ │ ├── CreateEnvironmentCommandFixture.cs
│ │ ├── DeletePackageCommandFixture.cs
│ │ ├── ChannelVersionRuleTesterFixture.cs
│ │ ├── CommandConventionFixture.cs
│ │ ├── SupportFormattedOutputFixture.cs
│ │ ├── ListLatestDeploymentsCommandFixture.cs
│ │ └── ListDeploymentsCommandFixture.cs
│ ├── Helpers
│ │ ├── TestCommandExtensions.cs
│ │ ├── ConsoleWriter.cs
│ │ └── ApprovalScrubberExtensions.cs
│ ├── Util
│ │ ├── UriExtensionsFixture.cs
│ │ └── CommandSuggesterFixture.cs
│ ├── Extensions
│ │ ├── TimeSpanExtensionsFixture.cs
│ │ └── StringExtensionsFixture.cs
│ ├── Diagnostics
│ │ └── LogUtilitiesFixture.cs
│ └── Octo.Tests.csproj
└── NuGet.Config
├── .nuke
└── parameters.json
├── certificates
├── signtool.exe
└── OctopusDevelopment.pfx
├── global.json
├── tools
└── packages.config
├── NuGet.Config
├── LICENSE.txt
├── Dockerfiles
├── alpine
│ └── Dockerfile
└── Readme.md
├── .gitattributes
├── .gitignore
├── readme.md
└── CHANGELOG.md
/version.txt:
--------------------------------------------------------------------------------
1 | 9.1.7
2 |
--------------------------------------------------------------------------------
/.octopus/schema_version.ocl:
--------------------------------------------------------------------------------
1 | version = 6
--------------------------------------------------------------------------------
/BuildAssets/octo.cmd:
--------------------------------------------------------------------------------
1 | dotnet "%~dp0/octo.dll" %*
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | @OctopusDeploy/team-integrations-fnm
--------------------------------------------------------------------------------
/source/Octo/runtimeconfig.template.json:
--------------------------------------------------------------------------------
1 | {
2 | "rollForward": "Major"
3 | }
--------------------------------------------------------------------------------
/BuildAssets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OctopusDeploy/OctopusCLI/HEAD/BuildAssets/icon.png
--------------------------------------------------------------------------------
/.nuke/parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./build.schema.json",
3 | "Solution": "source/OctopusCli.sln"
4 | }
--------------------------------------------------------------------------------
/certificates/signtool.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OctopusDeploy/OctopusCLI/HEAD/certificates/signtool.exe
--------------------------------------------------------------------------------
/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "6.0.101",
4 | "rollForward": "latestFeature"
5 | }
6 | }
--------------------------------------------------------------------------------
/source/Octopus.Cli/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OctopusDeploy/OctopusCLI/HEAD/source/Octopus.Cli/icon.png
--------------------------------------------------------------------------------
/source/Octo/Properties/Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OctopusDeploy/OctopusCLI/HEAD/source/Octo/Properties/Icon.ico
--------------------------------------------------------------------------------
/source/Octopus.DotNet.Cli/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OctopusDeploy/OctopusCLI/HEAD/source/Octopus.DotNet.Cli/icon.png
--------------------------------------------------------------------------------
/certificates/OctopusDevelopment.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OctopusDeploy/OctopusCLI/HEAD/certificates/OctopusDevelopment.pfx
--------------------------------------------------------------------------------
/tools/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BuildAssets/OctoWrapper.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | echo 'Deprecated: The Octo command has been renamed to octo.' >&2
3 | "$(dirname "$0")/octo" "$@"
4 |
--------------------------------------------------------------------------------
/source/Octo.Tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | [assembly: AssemblyTitle("OctopusTools.Tests")]
5 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.CompilerServices;
3 |
4 | [assembly: InternalsVisibleTo("Octo.Tests")]
5 |
--------------------------------------------------------------------------------
/BuildAssets/init.ps1:
--------------------------------------------------------------------------------
1 | param($installPath, $toolsPath, $package, $project)
2 |
3 | $path = $env:PATH
4 | if (!$path.Contains($toolsPath)) {
5 | $env:PATH += ";$toolsPath"
6 | }
--------------------------------------------------------------------------------
/source/Octo/init.ps1:
--------------------------------------------------------------------------------
1 | param($installPath, $toolsPath, $package, $project)
2 |
3 | $path = $env:PATH
4 | if (!$path.Contains($toolsPath)) {
5 | $env:PATH += ";$toolsPath"
6 | }
--------------------------------------------------------------------------------
/source/Octo.Tests/Commands/Resources/CreateRelease.config.txt:
--------------------------------------------------------------------------------
1 | server=https://test-server-url/api/
2 | apikey=API-test
3 | project=Test Project
4 | releaseNumber=1.0.0
5 | releasenotes=Test config file.
--------------------------------------------------------------------------------
/BuildAssets/VERIFICATION.txt:
--------------------------------------------------------------------------------
1 | VERIFICATION
2 | Verification is intended to assist the Chocolatey moderators and community
3 | in verifying that this package's contents are trustworthy.
4 |
5 | This package is published by the Octopus Deploy team itself.
--------------------------------------------------------------------------------
/source/Octo/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Octopus.Cli;
3 |
4 | namespace Octo
5 | {
6 | public class Program
7 | {
8 | public static int Main(string[] args)
9 | {
10 | return new CliProgram().Execute(args);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/source/Octopus.DotNet.Cli/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Octopus.Cli;
3 |
4 | namespace Octopus.DotNet.Cli
5 | {
6 | public static class Program
7 | {
8 | public static int Main(string[] args)
9 | {
10 | return new CliProgram().Execute(args);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Model/DeploymentRelatedResources.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Octopus.Client.Model;
3 |
4 | namespace Octopus.Cli.Model
5 | {
6 | public class DeploymentRelatedResources
7 | {
8 | public ChannelResource ChannelResource { get; set; }
9 | public ReleaseResource ReleaseResource { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | on:
2 | push:
3 | branches:
4 | - main
5 | name: release-please
6 | jobs:
7 | release-please:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: google-github-actions/release-please-action@v3
11 | with:
12 | release-type: simple
13 | token: ${{ secrets.INTEGRATIONS_FNM_BOT_TOKEN }}
14 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Util/LazyExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | // ReSharper disable CheckNamespace
4 | namespace Octopus.Cli.Util
5 | {
6 | public static class LazyExtensions
7 | // ReSharper restore CheckNamespace
8 | {
9 | public static T LoadValue(this Lazy lazy)
10 | {
11 | return lazy.Value;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Diagnostics/LoggingModule.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Autofac;
3 | using Serilog;
4 |
5 | namespace Octopus.Cli.Diagnostics
6 | {
7 | public class LoggingModule : Module
8 | {
9 | protected override void Load(ContainerBuilder builder)
10 | {
11 | builder.RegisterInstance(Log.Logger).As().SingleInstance();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/.octopus/deployment_settings.ocl:
--------------------------------------------------------------------------------
1 | deployment_changes_template = <<-EOT
2 | #{each release in Octopus.Deployment.Changes}
3 | #{release.ReleaseNotes}
4 | #{/each}
5 | EOT
6 |
7 | connectivity_policy {
8 | }
9 |
10 | versioning_strategy {
11 |
12 | donor_package {
13 | package = "PackageToUpload"
14 | step = "upload-octopustools-to-s3-public-with-hashes"
15 | }
16 | }
--------------------------------------------------------------------------------
/source/Octopus.Cli/Util/CommandOutputJsonSerializer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Octopus.Client.Serialization;
3 | using Octopus.CommandLine;
4 |
5 | namespace Octopus.Cli.Util
6 | {
7 | public class CommandOutputJsonSerializer : ICommandOutputJsonSerializer
8 | {
9 | public string SerializeObjectToJson(object o)
10 | {
11 | return JsonSerialization.SerializeObject(o);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/source/Octo.Tests/Helpers/TestCommandExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Octopus.CommandLine.Commands;
3 |
4 | // ReSharper disable CheckNamespace
5 | namespace Octopus.Cli.Tests.Helpers
6 | {
7 | public static class TestCommandExtensions
8 | // ReSharper restore CheckNamespace
9 | {
10 | public static void Execute(this ICommand command, params string[] args)
11 | {
12 | command.Execute(args).GetAwaiter().GetResult();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Commands/Releases/IChannelVersionRuleTester.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Octopus.Cli.Model;
4 | using Octopus.Client;
5 | using Octopus.Client.Model;
6 |
7 | namespace Octopus.Cli.Commands.Releases
8 | {
9 | public interface IChannelVersionRuleTester
10 | {
11 | Task Test(IOctopusAsyncRepository repository, ChannelVersionRuleResource rule, string packageVersion, string feedId);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/source/Octo/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | [assembly: AssemblyDescription("Tools for Octopus, an opinionated deployment solution for .NET applications")]
5 | [assembly: AssemblyCompany("Octopus Deploy")]
6 | [assembly: AssemblyProduct("Octopus, an opinionated deployment solution for .NET applications")]
7 | [assembly: AssemblyCopyright("Copyright © Octopus Deploy 2011")]
8 | [assembly: AssemblyCulture("")]
9 | [assembly: AssemblyTitle("OctopusTools")]
10 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Commands/Releases/IReleasePlanBuilder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Octopus.Client;
4 | using Octopus.Client.Model;
5 |
6 | namespace Octopus.Cli.Commands.Releases
7 | {
8 | public interface IReleasePlanBuilder
9 | {
10 | Task Build(IOctopusAsyncRepository repository,
11 | ProjectResource project,
12 | ChannelResource channel,
13 | string versionPreReleaseTag,
14 | string gitReference,
15 | string gitCommit);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Repositories/IActionTemplateRepository.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Octopus.Client.Model;
4 |
5 | namespace Octopus.Cli.Repositories
6 | {
7 | public interface IActionTemplateRepository
8 | {
9 | Task Get(string idOrHref);
10 | Task Create(ActionTemplateResource resource);
11 | Task Modify(ActionTemplateResource resource);
12 |
13 | Task FindByName(string name);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Util/AssemblyExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace Octopus.Cli.Util
5 | {
6 | public static class AssemblyExtensions
7 | {
8 | public static string GetInformationalVersion(this Type type)
9 | {
10 | return type.GetTypeInfo().Assembly.GetCustomAttribute().InformationalVersion;
11 | }
12 |
13 | public static string GetExecutableName()
14 | {
15 | return Assembly.GetEntryAssembly()?.GetName().Name ?? "octo";
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) Octopus Deploy and contributors. All rights reserved.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 | these files except in compliance with the License. You may obtain a copy of the
5 | License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software distributed
10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the
12 | specific language governing permissions and limitations under the License.
13 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Repositories/OctopusRepositoryFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Octopus.Client;
3 |
4 | namespace Octopus.Cli.Repositories
5 | {
6 | public interface IOctopusAsyncRepositoryFactory
7 | {
8 | IOctopusAsyncRepository CreateRepository(IOctopusAsyncClient client, RepositoryScope scope = null);
9 | }
10 |
11 | public class OctopusRepositoryFactory : IOctopusAsyncRepositoryFactory
12 | {
13 | public IOctopusAsyncRepository CreateRepository(IOctopusAsyncClient client, RepositoryScope scope = null)
14 | {
15 | return client.CreateRepository(scope);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/.octopus/channels.ocl:
--------------------------------------------------------------------------------
1 | channel "Default" {
2 | is_default = true
3 |
4 | rules {
5 | tag = "^$"
6 |
7 | deployment_action_packages {
8 | step = "Push Octopus.Cli to NuGet Gallery"
9 | package = "Octopus.Cli"
10 | }
11 | }
12 | }
13 |
14 | channel "Pre-Release" {
15 | description = ""
16 | lifecycle = "Components Internal only"
17 |
18 | rules {
19 | tag = ".+"
20 | version_range = ""
21 |
22 | deployment_action_packages {
23 | step = "Push Octopus.Cli to NuGet Gallery"
24 | package = "Octopus.Cli"
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Extensions/AttributeExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Reflection;
4 |
5 | namespace Octopus.Cli.Extensions
6 | {
7 | public static class AttributeExtensions
8 | {
9 | public static TValue GetAttributeValue(this Type type, Func valueSelector) where TAttribute : Attribute
10 | {
11 | var att = type.GetTypeInfo()
12 | .GetCustomAttributes(typeof(TAttribute), true)
13 | .FirstOrDefault() as TAttribute;
14 | if (att != null)
15 | return valueSelector(att);
16 | return default;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/BuildAssets/LICENSE.txt:
--------------------------------------------------------------------------------
1 | From: https://github.com/OctopusDeploy/OctopusCLI/blob/master/LICENSE.txt
2 |
3 | LICENSE
4 |
5 | Copyright (c) Octopus Deploy and contributors. All rights reserved.
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use
8 | these files except in compliance with the License. You may obtain a copy of the
9 | License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software distributed
14 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
15 | CONDITIONS OF ANY KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations under the License.
17 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Thank you for taking the time to log an issue. While we do monitor issues posted to this repository, we do not do so every day, so it may be some time before we respond.
2 |
3 | If you've found a bug or something isn't working, please [contact support](http://octopusdeploy.com/support), who can help you find a workaround or make sure the problem gets prioritized properly.
4 |
5 | If you are planning on sending a pull request, please see our [Contribution](Contributing.md) guide, and if appropriate clear this text out and submit your issue.
6 |
7 | If you have an idea or a feature request, and it is directly related to this product in this repository, clear out this text and create an issue. Otherwise, please post it to [our UserVoice site](http://octopusdeploy.uservoice.com) so others can vote for it.
8 |
--------------------------------------------------------------------------------
/BuildAssets/octo:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | SOURCE="${BASH_SOURCE[0]}"
3 | while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
4 | DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
5 | SOURCE="$(readlink "$SOURCE")"
6 | [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
7 | done
8 | OCTO_PATH="$( dirname "$SOURCE")/octo.dll"
9 | if [ "$(basename "$0")" == "Octo" ]; then
10 | echo 'Deprecated: The Octo command has been renamed to octo..' >&2
11 | fi
12 | # LTTNG_UST_REGISTER_TIMEOUT=0 is there to work around a bug in docker that causes an assertion violation in dotnet on first launch
13 | # See https://github.com/dotnet/cli/issues/1582
14 | LTTNG_UST_REGISTER_TIMEOUT=0 dotnet "$OCTO_PATH" "$@"
15 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Infrastructure/AutofacExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Autofac;
3 | using Autofac.Builder;
4 | using Octopus.CommandLine;
5 | using Octopus.CommandLine.Commands;
6 |
7 | namespace Octopus.Cli.Infrastructure
8 | {
9 | public static class AutofacExtensions
10 | {
11 | public static IRegistrationBuilder RegisterCommand(this ContainerBuilder builder, string name, string description, params string[] aliases)
12 | where TCommand : ICommand
13 | {
14 | return builder.RegisterType()
15 | .As()
16 | .WithMetadata(m => m.For(x => x.Name, name).For(x => x.Aliases, aliases).For(x => x.Description, description));
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/Octo.Tests/Util/UriExtensionsFixture.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using NUnit.Framework;
3 | using Octopus.Cli.Util;
4 |
5 | namespace Octo.Tests.Util
6 | {
7 | [TestFixture]
8 | public class UriExtensionsFixture
9 | {
10 | [Test]
11 | public void ShouldAppendSuffixIfThereIsNoOverlap()
12 | {
13 | var result = new Uri("http://www.mysite.com").EnsureEndsWith("suffix");
14 |
15 | Assert.AreEqual(result.ToString(), "http://www.mysite.com/suffix");
16 | }
17 |
18 | [Test]
19 | public void ShouldRemoveAnyOverlapBetweenBaseAddresAndSuffix()
20 | {
21 | var result = new Uri("http://www.mysite.com/virtual").EnsureEndsWith("/virtual/suffix");
22 |
23 | Assert.AreEqual(result.ToString(), "http://www.mysite.com/virtual/suffix");
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/source/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Commands/ExportCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Octopus.Cli.Util;
4 | using Octopus.CommandLine;
5 | using Octopus.CommandLine.Commands;
6 |
7 | namespace Octopus.Cli.Commands
8 | {
9 | [Command("export", Description = "Exports an object to a JSON file. Deprecated. Please see https://g.octopushq.com/DataMigration for alternative options.")]
10 | public class ExportCommand : CommandBase
11 | {
12 | public override Task Execute(string[] commandLineArgs)
13 | {
14 | throw new CommandException($"The {AssemblyExtensions.GetExecutableName()} import/export commands have been deprecated. See https://g.octopushq.com/DataMigration for alternative options.");
15 | }
16 |
17 | public ExportCommand(ICommandOutputProvider commandOutputProvider) : base(commandOutputProvider)
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Commands/Package/IPackageBuilder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using NuGet.Packaging;
4 |
5 | namespace Octopus.Cli.Commands.Package
6 | {
7 | public enum PackageCompressionLevel
8 | {
9 | None,
10 | Fast,
11 | Optimal
12 | }
13 |
14 | public enum PackageFormat
15 | {
16 | Zip,
17 | NuPkg,
18 |
19 | [Obsolete("This is just here for backwards compat")]
20 | Nuget
21 | }
22 |
23 | public interface IPackageBuilder
24 | {
25 | string[] Files { get; }
26 |
27 | string PackageFormat { get; }
28 |
29 | void BuildPackage(string basePath,
30 | IList includes,
31 | ManifestMetadata metadata,
32 | string outFolder,
33 | bool overwrite,
34 | bool verboseInfo);
35 |
36 | void SetCompression(PackageCompressionLevel level);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/source/Octo.Tests/Commands/ListReleasesCommandFixture.ShouldGetListOfReleases.approved.txt:
--------------------------------------------------------------------------------
1 | Octopus Deploy Command Line Tool, version
2 |
3 | Releases: 4
4 | - Project: ProjectA
5 | Version: 1.0
6 | Assembled:
7 | Package Versions: Deploy a package 1.0
8 | Release Notes: Release Notes 1
9 |
10 | Version: 2.0
11 | Assembled:
12 | Package Versions:
13 | Release Notes: Release Notes 2
14 |
15 | Version: whateverdockerversion
16 | Assembled:
17 | Package Versions:
18 | Release Notes: Release Notes 3
19 |
20 | - Project: ProjectB
21 | - Project: Version controlled project
22 | Version: 1.2.3
23 | Assembled:
24 | Package Versions:
25 | Release Notes: Version controlled release notes
26 | Git Reference: main
27 | Git Commit: 87a072ad2b4a2e9bf2d7ff84d8636a032786394d
28 |
29 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Model/ProjectExport.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Octopus.Client.Model;
4 |
5 | namespace Octopus.Cli.Model
6 | {
7 | public class ProjectExport
8 | {
9 | public ProjectResource Project { get; set; }
10 | public ReferenceDataItem ProjectGroup { get; set; }
11 | public VariableSetResource VariableSet { get; set; }
12 | public List NuGetFeeds { get; set; }
13 | public List ActionTemplates { get; set; }
14 | public DeploymentProcessResource DeploymentProcess { get; set; }
15 | public List LibraryVariableSets { get; set; }
16 | public ReferenceDataItem Lifecycle { get; set; }
17 | public List Channels { get; set; }
18 | public List ChannelLifecycles { get; set; }
19 | public List WorkerPools { get; set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/source/Octo.Tests/Extensions/TimeSpanExtensionsFixture.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using NUnit.Framework;
3 | using Octopus.Cli.Extensions;
4 |
5 | namespace Octo.Tests.Extensions
6 | {
7 | [TestFixture]
8 | public class TimeSpanExtensionsFixture
9 | {
10 | [Test]
11 | public void FormattingTests()
12 | {
13 | Assert.That(new TimeSpan(3, 2, 5, 7).Friendly(), Is.EqualTo("3 days, 2h:5m:7s"));
14 | Assert.That(new TimeSpan(1, 2, 5, 7).Friendly(), Is.EqualTo("1 day, 2h:5m:7s"));
15 | Assert.That(new TimeSpan(0, 2, 5, 7).Friendly(), Is.EqualTo("2h:5m:7s"));
16 | Assert.That(new TimeSpan(0, 0, 5, 7).Friendly(), Is.EqualTo("5m:7s"));
17 | Assert.That(new TimeSpan(0, 0, 0, 7).Friendly(), Is.EqualTo("7s"));
18 | Assert.That(new TimeSpan(0, 0, 0, 0).Friendly(), Is.EqualTo("0s"));
19 | Assert.That(TimeSpan.FromSeconds(84).Friendly(), Is.EqualTo("1m:24s"));
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Commands/VersionCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Octopus.Cli.Util;
4 | using Octopus.CommandLine;
5 | using Octopus.CommandLine.Commands;
6 |
7 | namespace Octopus.Cli.Commands
8 | {
9 | [Command("version", "v", "ver", Description = "Outputs Octopus CLI version.")]
10 | public class VersionCommand : CommandBase
11 | {
12 | public VersionCommand(ICommandOutputProvider commandOutputProvider) : base(commandOutputProvider)
13 | {
14 | }
15 |
16 | public override Task Execute(string[] commandLineArgs)
17 | {
18 | return Task.Run(() =>
19 | {
20 | Options.Parse(commandLineArgs);
21 |
22 | if (printHelp)
23 | GetHelp(Console.Out, commandLineArgs);
24 | else
25 | Console.WriteLine($"{typeof(CliProgram).GetInformationalVersion()}");
26 | });
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Extensions/TimeSpanExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Octopus.Cli.Extensions
4 | {
5 | public static class TimeSpanExtensions
6 | {
7 | public static string Friendly(this TimeSpan time)
8 | {
9 | if (time.TotalDays >= 1.0)
10 | return string.Format("{0:n0} day{1}, {2:n0}h:{3:n0}m:{4:n0}s",
11 | time.TotalDays,
12 | time.TotalDays >= 1.9 ? "s" : "",
13 | time.Hours,
14 | time.Minutes,
15 | time.Seconds);
16 |
17 | if (time.TotalHours >= 1.0)
18 | return string.Format("{0:n0}h:{1:n0}m:{2:n0}s", time.TotalHours, time.Minutes, time.Seconds);
19 |
20 | if (time.TotalMinutes >= 1.0)
21 | return string.Format("{0:n0}m:{1:n0}s", time.TotalMinutes, time.Seconds);
22 |
23 | return string.Format("{0:n0}s", time.TotalSeconds);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Util/NumericExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Octopus.Cli.Util
4 | {
5 | public static class NumericExtensions
6 | {
7 | const long Kilobyte = 1024;
8 | const long Megabyte = 1024 * Kilobyte;
9 | const long Gigabyte = 1024 * Megabyte;
10 | const long Terabyte = 1024 * Gigabyte;
11 |
12 | public static string ToFileSizeString(this long bytes)
13 | {
14 | return ToFileSizeString(bytes <= 0 ? 0 : (ulong)bytes);
15 | }
16 |
17 | public static string ToFileSizeString(this ulong bytes)
18 | {
19 | if (bytes > Terabyte) return (bytes / Terabyte).ToString("0 TB");
20 | if (bytes > Gigabyte) return (bytes / Gigabyte).ToString("0 GB");
21 | if (bytes > Megabyte) return (bytes / Megabyte).ToString("0 MB");
22 | if (bytes > Kilobyte) return (bytes / Kilobyte).ToString("0 KB");
23 | return bytes + " bytes";
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Commands/ImportCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Threading.Tasks;
4 | using Octopus.Cli.Repositories;
5 | using Octopus.Cli.Util;
6 | using Octopus.Client;
7 | using Octopus.CommandLine;
8 | using Octopus.CommandLine.Commands;
9 |
10 | namespace Octopus.Cli.Commands
11 | {
12 | [Command("import", Description = "Imports an Octopus object from an export file. Deprecated. Please see https://g.octopushq.com/DataMigration for alternative options.")]
13 | public class ImportCommand : CommandBase
14 | {
15 | public override Task Execute(string[] commandLineArgs)
16 | {
17 | throw new CommandException($"The {AssemblyExtensions.GetExecutableName()} import/export commands have been deprecated. See https://g.octopushq.com/DataMigration for alternative options.");
18 | }
19 |
20 | public ImportCommand(ICommandOutputProvider commandOutputProvider) : base(commandOutputProvider)
21 | {
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Dockerfiles/alpine/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine
2 |
3 | # Alpine base image does not have ICU libraries available
4 | # https://github.com/dotnet/corefx/blob/master/Documentation/architecture/globalization-invariant-mode.md
5 | RUN apk add --no-cache icu-libs
6 | ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT false
7 | ENV LC_ALL en_US.UTF-8
8 | ENV LANG en_US.UTF-8
9 |
10 | # The dotnetcore bootstrapper doesnt work in alpine shell (built for bash)
11 | # This allows invoking octo if running interactive container
12 | RUN mkdir /octo &&\
13 | echo "dotnet /octo/octo.dll \"\$@\"" > /octo/alpine &&\
14 | ln /octo/alpine /usr/bin/octo &&\
15 | chmod +x /usr/bin/octo
16 |
17 | ARG OCTO_TOOLS_VERSION=4.31.1
18 |
19 | LABEL maintainer="devops@octopus.com"
20 | LABEL octopus.dockerfile.version="1.0"
21 | LABEL octopus.tools.version=$OCTO_TOOLS_VERSION
22 |
23 | ADD OctopusTools.$OCTO_TOOLS_VERSION.portable.tar.gz /octo
24 |
25 | WORKDIR /src
26 | ENTRYPOINT ["dotnet", "/octo/octo.dll"]
27 |
--------------------------------------------------------------------------------
/source/Octo.Tests/Helpers/ConsoleWriter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Text;
4 |
5 | namespace Octopus.Cli.Tests.Helpers
6 | {
7 | //copied from https://stackoverflow.com/a/11911734/779192
8 | public class ConsoleWriter : TextWriter
9 | {
10 | public override Encoding Encoding => Encoding.UTF8;
11 |
12 | public override void Write(string value)
13 | {
14 | WriteEvent?.Invoke(this, new ConsoleWriterEventArgs(value));
15 | }
16 |
17 | public override void WriteLine(string value)
18 | {
19 | WriteLineEvent?.Invoke(this, new ConsoleWriterEventArgs(value));
20 | }
21 |
22 | public event EventHandler WriteEvent;
23 | public event EventHandler WriteLineEvent;
24 |
25 | public class ConsoleWriterEventArgs : EventArgs
26 | {
27 | public ConsoleWriterEventArgs(string value)
28 | {
29 | Value = value;
30 | }
31 |
32 | public string Value { get; }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Confused? https://help.github.com/articles/dealing-with-line-endings/
2 | # Set the default behavior, in case people don't have core.autocrlf set.
3 | * text=auto
4 |
5 | *.doc diff=astextplain
6 | *.DOC diff=astextplain
7 | *.docx diff=astextplain
8 | *.DOCX diff=astextplain
9 | *.dot diff=astextplain
10 | *.DOT diff=astextplain
11 | *.pdf diff=astextplain
12 | *.PDF diff=astextplain
13 | *.rtf diff=astextplain
14 | *.RTF diff=astextplain
15 |
16 | *.bmp binary
17 | *.gif binary
18 | *.jpg binary
19 | *.png binary
20 |
21 | *.ascx text
22 | *.cmd text
23 | *.coffee text
24 | *.config text
25 | *.cs text diff=csharp
26 | *.css text
27 | *.less text
28 | *.cshtml text
29 | *.htm text
30 | *.html text
31 | *.htm text
32 | *.js text
33 | *.json text
34 | *.msbuild text
35 | *.resx text
36 | *.ruleset text
37 | *.Stylecop text
38 | *.targets text
39 | *.tt text
40 | *.txt text
41 | *.vb text
42 | *.vbhtml text
43 | *.xml text
44 | *.xunit text
45 |
46 | *.csproj text merge=union
47 | *.vbproj text merge=union
48 |
49 | *.sln text eol=crlf merge=union
50 |
51 | *.approved.* -text
52 |
53 | octo eol=lf
54 | *.sh eol=lf
55 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to Contribute
2 | Thank you for going to the effort of contributing some code.
3 |
4 | If you've found a bug or something isn't working, please quickly check the issues in
5 | our [main issue repository](https://github.com/OctopusDeploy/Issues).
6 |
7 | If your change is small or you have already made the change, please go ahead and submit a pull request.
8 |
9 | For other changes, please raise an issue first to check that the change aligns with our plan for the product. We ask this to avoid disappointment and wasted effort if it does not.
10 |
11 | If your pull request or proposed change is for a bug that is causing problems for you, please also [contact support](http://octopusdeploy.com/support) referencing your pull request to make sure it gets prioritized properly. They may also be able to find a work around in the meantime.
12 |
13 | If you have an idea or a feature request, please post it to [our UserVoice site](http://octopusdeploy.uservoice.com) so others can vote for it.
14 |
15 | You will need to have this [version of .NET Core SDK](https://download.microsoft.com/download/0/A/3/0A372822-205D-4A86-BFA7-084D2CBE9EDF/DotNetCore.1.0.1-SDK.1.0.0.Preview2-003133-x64.exe) installed to compile the solution.
--------------------------------------------------------------------------------
/source/Octo.Tests/Helpers/ApprovalScrubberExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text.RegularExpressions;
3 |
4 | namespace Octopus.Cli.Tests.Helpers
5 | {
6 | public static class ApprovalScrubberExtensions
7 | {
8 | static readonly Regex CliVersionScrubber = new Regex("(?<=Octopus Deploy Command Line Tool, version\\s)[^\\s]+", RegexOptions.Compiled | RegexOptions.IgnoreCase);
9 |
10 | static readonly Regex AssembledTimestampScrubber = new Regex(@"Assembled: (?.*)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
11 |
12 | public static string ScrubApprovalString(this string approval)
13 | {
14 | return approval.ScrubCliVersion().ScrubAssembledTimestamps();
15 | }
16 |
17 | static string ScrubCliVersion(this string subject)
18 | {
19 | return CliVersionScrubber.Replace(subject, "");
20 | }
21 |
22 | static string ScrubAssembledTimestamps(this string subject)
23 | {
24 | foreach (Match m in AssembledTimestampScrubber.Matches(subject))
25 | subject = subject.Replace(m.Groups["assembled"].Value, "");
26 | return subject;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.*scc
2 | *.FileListAbsolute.txt
3 | *.aps
4 | *.bak
5 | *.[Cc]ache
6 | *.clw
7 | *.eto
8 | *.fb6lck
9 | *.fbl6
10 | *.fbpInf
11 | *.ilk
12 | *.lib
13 | *.log
14 | *.ncb
15 | *.nlb
16 | *.obj
17 | *.patch
18 | *.pch
19 | *.pdb
20 | *.plg
21 | *.[Pp]ublish.xml
22 | *.rdl.data
23 | *.sbr
24 | *.scc
25 | *.sig
26 | *.sqlsuo
27 | *.suo
28 | *.svclog
29 | *.tlb
30 | *.tlh
31 | *.tli
32 | *.tmp
33 | *.user
34 | *.vshost.*
35 | *DXCore.Solution
36 | *_i.c
37 | *_p.c
38 | Ankh.Load
39 | Backup*/
40 | CVS/
41 | PrecompiledWeb/
42 | UpgradeLog*.*
43 | [Bb]in/
44 | [Dd]ebug/
45 | [Oo]bj/
46 | [Rr]elease/
47 | [Tt]humbs.db
48 | _UpgradeReport_Files
49 | _[Rr]e[Ss]harper.*/
50 | hgignore[.-]*
51 | ignore[.-]*
52 | svnignore[.-]*
53 | lint.db
54 | *.ReSharper
55 | source/packages
56 | source/OctopusTools.v2.ncrunchsolution
57 | *.orig
58 | *.userprefs
59 | *.lock.json
60 | .vs
61 | .vscode
62 | /tools/Addins/
63 | /tools/Cake/
64 | /tools/GitVersion.CommandLine
65 | /tools/ILRepack
66 | /tools/*
67 | !/tools/packages.config
68 | /artifacts/
69 | /publish/
70 | TestResult.xml
71 | TestResults/
72 | *.received.*
73 | .idea/
74 | /source/Octo/Properties/launchSettings.json
75 | **/ExpectedSdkVersion.txt
76 | **/launchSettings.json
77 |
78 | .DS_Store
79 |
80 | octoversion.txt
81 |
--------------------------------------------------------------------------------
/source/Octo.Tests/Diagnostics/LogUtilitiesFixture.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentAssertions;
3 | using NUnit.Framework;
4 | using Octopus.Cli.Diagnostics;
5 | using Octopus.CommandLine.Commands;
6 | using Serilog.Events;
7 |
8 | namespace Octo.Tests.Diagnostics
9 | {
10 | [TestFixture]
11 | public sealed class LogUtilitiesFixture
12 | {
13 | [Test]
14 | public void ShouldThrowIfUnknownLogLevelIsProvided()
15 | {
16 | var result = Assert.Throws(() => LogUtilities.ParseLogLevel("z"));
17 | result.Message.ShouldBeEquivalentTo("Unrecognized loglevel 'z'. Valid options are verbose, debug, information, warning, error and fatal. " +
18 | "Defaults to 'debug'.");
19 | }
20 |
21 | [TestCase("fatal", LogEventLevel.Fatal)]
22 | [TestCase("error", LogEventLevel.Error)]
23 | [TestCase("warning", LogEventLevel.Warning)]
24 | [TestCase("information", LogEventLevel.Information)]
25 | [TestCase("debug", LogEventLevel.Debug)]
26 | [TestCase("verbose", LogEventLevel.Verbose)]
27 | public void ShouldParseLogLevelCorrectly(string value, LogEventLevel level)
28 | {
29 | var result = LogUtilities.ParseLogLevel(value);
30 | result.ShouldBeEquivalentTo(level);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Util/UriExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | // ReSharper disable CheckNamespace
4 | namespace Octopus.Cli.Util
5 | {
6 | public static class UriExtensions
7 | // ReSharper restore CheckNamespace
8 | {
9 | public static Uri EnsureEndsWith(this Uri uri, string suffix)
10 | {
11 | var path = uri.AbsolutePath.ToLowerInvariant();
12 | suffix = suffix.ToLowerInvariant();
13 | var overlap = FindOverlapSection(path, suffix);
14 | if (!string.IsNullOrEmpty(overlap))
15 | {
16 | path = path.Replace(overlap, string.Empty);
17 | suffix = suffix.Replace(overlap, string.Empty);
18 | }
19 |
20 | path = path + overlap + suffix;
21 | path = path.Replace("//", "/");
22 |
23 | return new Uri(uri, path);
24 | }
25 |
26 | static string FindOverlapSection(string value1, string value2)
27 | {
28 | var longer = value1;
29 | var shorter = value2;
30 | if (shorter.Length > longer.Length)
31 | {
32 | var temp = longer;
33 | longer = shorter;
34 | shorter = temp;
35 | }
36 |
37 | return longer.Contains(shorter) ? shorter : string.Empty;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/BuildAssets/OctopusTools.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OctopusTools
5 | Octopus CLI
6 | $version$
7 | Octopus Deploy
8 | Octopus Deploy
9 | Create, deploy and promote releases using Octopus Deploy.
10 |
11 | Octopus is a user-friendly DevOps tool for developers that supports release management, deployment automation, and operations runbooks.
12 |
13 | This package contains the Octopus CLI (octo), a tool to create and deploy releases, create and push packages, and manage environments with Octopus.
14 |
15 |
16 | en-US
17 | false
18 | Apache-2.0
19 | https://github.com/OctopusDeploy/OctopusCLI/
20 |
21 | tools\icon.png
22 | automation deployment
23 | true
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/source/Octo/Octo.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1;net6.0
5 | true
6 | portable
7 | octo
8 | Exe
9 | OctopusTools
10 | false
11 | false
12 | false
13 | false
14 | false
15 | Octo
16 | true
17 | win-x64;linux-x64;osx-x64
18 |
19 |
20 |
21 |
22 | all
23 | runtime; build; native; contentfiles; analyzers
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Model/ChannelVersionRuleTestResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Octopus.Client.Model;
4 |
5 | namespace Octopus.Cli.Model
6 | {
7 | public class ChannelVersionRuleTestResult : Resource
8 | {
9 | const string Pass = "PASS";
10 | const string Fail = "FAIL";
11 | public IEnumerable Errors { get; set; }
12 | public bool SatisfiesVersionRange { get; set; }
13 | public bool SatisfiesPreReleaseTag { get; set; }
14 | public bool IsSatisfied => SatisfiesVersionRange && SatisfiesPreReleaseTag;
15 | public bool IsNull { get; private set; }
16 |
17 | public string ToSummaryString()
18 | {
19 | return IsNull ? "Allow any version" : $"Range: {(SatisfiesVersionRange ? Pass : Fail)} Tag: {(SatisfiesPreReleaseTag ? Pass : Fail)}";
20 | }
21 |
22 | public static ChannelVersionRuleTestResult Failed()
23 | {
24 | return new ChannelVersionRuleTestResult
25 | {
26 | IsNull = false,
27 | SatisfiesVersionRange = false,
28 | SatisfiesPreReleaseTag = false
29 | };
30 | }
31 |
32 | public static ChannelVersionRuleTestResult Null()
33 | {
34 | return new ChannelVersionRuleTestResult
35 | {
36 | IsNull = true,
37 | SatisfiesVersionRange = true,
38 | SatisfiesPreReleaseTag = true
39 | };
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/source/Octopus.Cli/Util/StringExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Text.RegularExpressions;
5 | using Octopus.CommandLine.Commands;
6 |
7 | namespace Octopus.Cli.Util
8 | {
9 | public static class StringExtensions
10 | {
11 | public static string CommaSeperate(this IEnumerable