Skip to content

Commit 251482b

Browse files
committed
Add parameter to control --(no)self-contained in build scripts
1 parent 3f5e2fc commit 251482b

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

build/Build-Docker-Worker.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ param
22
(
33
[Parameter()]
44
[ValidateSet('Debug', 'Release')]
5-
[string]$Configuration = 'Debug'
5+
[string]$Configuration = 'Debug',
6+
7+
[Parameter()]
8+
[boolean]$SelfContained = $true
69
)
710

811
$ErrorActionPreference = 'Stop'
912

1013
$currentDirectory = $PSScriptRoot
1114
$scriptPath = Join-Path $currentDirectory 'Build-Docker.ps1'
1215

13-
& $scriptPath -AppName 'Dibix.Worker.Host'
16+
& $scriptPath -AppName 'Dibix.Worker.Host' -Configuration $Configuration -SelfContained $SelfContained

build/Build-Host-Http.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ param
22
(
33
[Parameter()]
44
[ValidateSet('Debug', 'Release')]
5-
[string]$Configuration = 'Debug'
5+
[string]$Configuration = 'Debug',
6+
7+
[Parameter()]
8+
[boolean]$SelfContained = $true
69
)
710

811
$ErrorActionPreference = 'Stop'
912

1013
$currentDirectory = $PSScriptRoot
1114
$scriptPath = Join-Path $currentDirectory 'Build-Host.ps1'
1215

13-
& $scriptPath -AppName 'Dibix.Http.Host' -Configuration $Configuration
16+
& $scriptPath -AppName 'Dibix.Http.Host' -Configuration $Configuration -SelfContained $SelfContained

build/Build-Host.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ param
66

77
[Parameter()]
88
[ValidateSet('Debug', 'Release')]
9-
[string]$Configuration = 'Debug'
9+
[string]$Configuration = 'Debug',
10+
11+
[Parameter()]
12+
[boolean]$SelfContained = $true
1013
)
1114

1215
$ErrorActionPreference = 'Stop'
@@ -27,7 +30,7 @@ else
2730
{
2831
Exec "dotnet publish --configuration $Configuration
2932
--runtime $runtimeIdentifier
30-
--self-contained
33+
$(if ($SelfContained) { "--self-contained" } else { "--no-self-contained" })
3134
--p:IgnoreProjectGuid=True
3235
--p:PublishReadyToRun=$publishReadyToRun
3336
--p:PublishSingleFile=$publishSingleFile

0 commit comments

Comments
 (0)