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

Commit 928bc8e

Browse files
authored
Update publish scripts (#3390)
Fixes #3387
1 parent a390561 commit 928bc8e

File tree

3 files changed

+18
-21
lines changed
  • samples/csharp/assistants
    • enterprise-assistant/VirtualAssistantSample/Deployment/Scripts
    • hospitality-assistant/VirtualAssistantSample/Deployment/Scripts
    • virtual-assistant/VirtualAssistantSample/Deployment/Scripts

3 files changed

+18
-21
lines changed

samples/csharp/assistants/enterprise-assistant/VirtualAssistantSample/Deployment/Scripts/publish.ps1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,13 @@ if (-not $resourceGroup) {
5050
$resourceGroup = Read-Host "? Bot Resource Group"
5151
}
5252

53+
# Get path to csproj file
54+
$projFile = Get-ChildItem $projFolder `
55+
| Where-Object {$_.extension -eq ".csproj" } `
56+
| Select-Object -First 1
57+
5358
# Check for existing deployment files
5459
if (-not (Test-Path (Join-Path $projFolder '.deployment'))) {
55-
56-
# Get path to csproj file
57-
$projFile = Get-ChildItem $projFolder `
58-
| Where-Object {$_.extension -eq ".csproj" } `
59-
| Select-Object -First 1
60-
6160
# Add needed deployment files for az
6261
az bot prepare-deploy --lang Csharp --code-dir $projFolder --proj-file-path $projFile.name --output json | Out-Null
6362
}
@@ -70,7 +69,7 @@ if (Test-Path $zipPath) {
7069

7170
# Perform dotnet publish step ahead of zipping up
7271
$publishFolder = $(Join-Path $projFolder 'bin\Release\netcoreapp3.0')
73-
dotnet publish -c release -o $publishFolder -v q > $logFile
72+
dotnet publish $projFile -c release -o $publishFolder -v q > $logFile
7473

7574
if($?) {
7675
# Compress source code

samples/csharp/assistants/hospitality-assistant/VirtualAssistantSample/Deployment/Scripts/publish.ps1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,13 @@ if (-not $resourceGroup) {
5050
$resourceGroup = Read-Host "? Bot Resource Group"
5151
}
5252

53+
# Get path to csproj file
54+
$projFile = Get-ChildItem $projFolder `
55+
| Where-Object {$_.extension -eq ".csproj" } `
56+
| Select-Object -First 1
57+
5358
# Check for existing deployment files
5459
if (-not (Test-Path (Join-Path $projFolder '.deployment'))) {
55-
56-
# Get path to csproj file
57-
$projFile = Get-ChildItem $projFolder `
58-
| Where-Object {$_.extension -eq ".csproj" } `
59-
| Select-Object -First 1
60-
6160
# Add needed deployment files for az
6261
az bot prepare-deploy --lang Csharp --code-dir $projFolder --proj-file-path $projFile.name --output json | Out-Null
6362
}
@@ -70,7 +69,7 @@ if (Test-Path $zipPath) {
7069

7170
# Perform dotnet publish step ahead of zipping up
7271
$publishFolder = $(Join-Path $projFolder 'bin\Release\netcoreapp3.0')
73-
dotnet publish -c release -o $publishFolder -v q > $logFile
72+
dotnet publish $projFile -c release -o $publishFolder -v q > $logFile
7473

7574
if($?) {
7675
# Compress source code

samples/csharp/assistants/virtual-assistant/VirtualAssistantSample/Deployment/Scripts/publish.ps1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,13 @@ if (-not $resourceGroup) {
5050
$resourceGroup = Read-Host "? Bot Resource Group"
5151
}
5252

53+
# Get path to csproj file
54+
$projFile = Get-ChildItem $projFolder `
55+
| Where-Object {$_.extension -eq ".csproj" } `
56+
| Select-Object -First 1
57+
5358
# Check for existing deployment files
5459
if (-not (Test-Path (Join-Path $projFolder '.deployment'))) {
55-
56-
# Get path to csproj file
57-
$projFile = Get-ChildItem $projFolder `
58-
| Where-Object {$_.extension -eq ".csproj" } `
59-
| Select-Object -First 1
60-
6160
# Add needed deployment files for az
6261
az bot prepare-deploy --lang Csharp --code-dir $projFolder --proj-file-path $projFile.name --output json | Out-Null
6362
}
@@ -70,7 +69,7 @@ if (Test-Path $zipPath) {
7069

7170
# Perform dotnet publish step ahead of zipping up
7271
$publishFolder = $(Join-Path $projFolder 'bin\release\netcoreapp3.0')
73-
dotnet publish -c release -o $publishFolder -v q > $logFile
72+
dotnet publish $projFile -c release -o $publishFolder -v q > $logFile
7473

7574
if($?) {
7675
# Compress source code

0 commit comments

Comments
 (0)