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                
nuke :add-package dotnet-deploy --version 0.9.0                

Dotnet deploy tool

Nuget

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 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.

Version Downloads Last updated
0.9.0 80 2/7/2025
0.8.0 63 2/6/2025
0.7.2 43 1/24/2025
0.7.1 44 1/24/2025
0.7.0 58 1/24/2025
0.6.1 67 1/24/2025
0.6.0 49 1/24/2025
0.5.1 74 1/22/2025
0.5.0 67 1/22/2025
0.4.0 69 1/21/2025
0.3.1 58 1/15/2025
0.2.1 97 11/20/2024
0.2.0 114 9/23/2024