Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Commit 73f0973

Browse files
authored
Merge pull request #19 from gingters/patch-1
Updated docs to support projects targeting multiple runtimes
2 parents a199be2 + f271fa7 commit 73f0973

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ dotnet tool install -g dotnet-sshdeploy --add-source ./
6868
* **If no RuntimeIdentifier is provided a [Framework-dependent deployment](https://docs.microsoft.com/en-us/dotnet/core/deploying/) will be created otherwise a [Self-contained deployment](https://docs.microsoft.com/en-us/dotnet/core/deploying/) will**
6969
* **The command neds to be excute in the same folder as the csproj**
7070

71+
If your project happens to target multiple runtimes, i.e. `win-x64` and `linux-arm`, then sshdeploy does not necessarily know which binaries to deploy. Also, you might want to control that i.e. only the `linux-arm` build should be automatically deployed. In this case, you can change the post build event and add an additional condition to the target (only run on builds for linux), and also pass the desired runtime identifier to the actual deployment call as follows:
72+
73+
```xml
74+
<Target Condition="$(BuildingInsideSshDeploy) == '' and $(RuntimeIdentifier) == 'linux-arm'" Name="PostBuild" AfterTargets="PostBuildEvent">
75+
<Exec Command="cd $(ProjectDir)" />
76+
<Exec Command="dotnet-sshdeploy push -r $(RuntimeIdentifier)" />
77+
</Target>
78+
```
79+
7180
#### Monitor
7281
1. Go to your Visual Studio Solution (the one you intend to continuously deploy to the Raspberry Pi).
7382
2. Right-click on the project and click on the menu item "Properties"

0 commit comments

Comments
 (0)