Dot Net Core Application Packaging using Octo
Octo.exe is a command line tool that
interacts with the Octopus Deploy REST API and includes a pack command to
create packages either as Zip or NuGet packages for deployment with Octopus.
Installation
We recommend installing Octo as a global tool
using .NET Core which makes Octo available as a command via the .NET CLI.
If you have the .NET Core 2.1.300 SDK
available you can install Octo onto a machine or build agent as a global tool
with the following command:
dotnet
tool install Octopus.DotNet.Cli –global
Publish
your application
There are two ways to publish your dot net
core application. One you can do from command line and other from Dote net
solution it self.
Command
Line
Dot net
publish source/sharjeelsWorkCore.Web --output published-app --configuration
Release
dotnet
publish
F:\RSI\SharjeelsWork\RD\Core\sharjeelsWorkCore\sharjeelsWorkCore\sharjeelsWorkCore.csproj
--output published-app --configuration Release
Dote Net Solution
Right click on your Dot net core project and
select publish.
Once publishing is completed then you can
check published item from given location. In my case location was
F:\RSI\SharjeelsWork\RD\Core\sharjeelsWorkCore\sharjeelsWorkCore\bin\Release\netcoreapp2.1\publish
At a minimum Octo pack requires an ID to be
provided. Also if you want to provide your own version, you can pass the
--version parameter in the call to Octo.
You can also change the output directory and
folder which will be packed with the --outFolder and --basePath parameters
respectively. I am combining all three point in single command
dotnet
octo pack --id="SharjeelsWork-OctoWeb" --version="1.0.6"
--format=zip --basePath=" F:\RSI\SharjeelsWork\RD\Core\sharjeelsWorkCore\sharjeelsWorkCore\bin\Release\netcoreapp2.1\publish"
--outFolder=" F:\RSI\SharjeelsWork\Octopus\Packages\DotNetCore"
Upgrade
Octo version
If you would like to update to a specific
version or downgrade to an older version you can do so by first uninstalling
the tool and installing it again.
dotnet tool uninstall Octopus.DotNet.Cli
--global
dotnet tool install Octopus.DotNet.Cli
--global --version <version>
whenever you are creating dot net core
packages through command line, take care of location path and version. In next
article I will try to describe more on Octopus deployment.
Happy
Learning!!!
Comments
Post a Comment