dotnet-deploy
0.9.0
dotnet tool install --global dotnet-deploy --version 0.9.0
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local dotnet-deploy --version 0.9.0
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-deploy&version=0.9.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package dotnet-deploy --version 0.9.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Dotnet deploy tool
Install
Install on global environment
dotnet tool install dotnet-deploy -g
Or install on local directory
cd ./you_solution_directory
dotnet new tool-manifest
dotnet tool install dotnet-deploy
Quick start
Publish to remote host
dotnet deploy publish --host 127.0.0.1 --password abc123 --username root
Install a systemd service
Run
dotnet deploy publish
command will auto restart service when system service installed
dotnet deploy systemd install --host 127.0.0.1 --password abc123 --username root
Use appsettings.json and user-secrets simplify command options
Define a Deploy
section on configuration file
{
...
"Deploy": {
"Host": "127.0.0.1",
"Username": "root"
}
}
Use user-secrets
protect host password
dotnet user-secrets set Deploy:password abc123
Command will auto read project configuration value
dotnet deploy publish
Commands
publish
dotnet deploy publish
info
dotnet deploy info
systemd
install systemd service
dotnet deploy systemd install
uninstall systemd service
dotnet deploy systemd uninstall
restart systemd service
dotnet deploy systemd restart
get systemd service status
dotnet deploy systemd status
FAQ
Directory contains multi project
dotnet deploy publish --project ./src/my_project
Project contains multi csproj files
dotnet deploy publish --project ./src/my_project/my_project.csproj
Support OS
Current version test on ubuntu,there is no guarantee that all linux distributions will work well,more case will be test on future
Default deploy resource path on remote host
Project publish file: /var/dotnet-apps/[project_name]
Service file: /etc/systemd/system/[project_name].service
Command document
all command use -h
can see command description
dotnet deploy publish -h
Description:
Publish project to remote host
Usage:
DotnetDeploy publish [options]
Options:
--host Target host name or domain
--username SSH username
--password SSH password
--private-key SSH private key
--project Project path
--include-files Copy the specified project file or directory to output directory
--all-hosts Publish all hosts
--before-command Run command before dotnet publish
--after-command Run command after dotnet publish
-?, -h, --help Show help and usage information
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.