Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ stages:
appId: $(BFCFNEMPTYBOTJSWEBAPPID)
appSecret: $(BFCFNEMPTYBOTJSWEBAPPSECRET)
project:
directory: 'Tests/Functional/Bots/JavaScript/Consumers/CodeFirst/SimpleHostBot'
generator: "generators/generator-bot-empty"
integration: "webapp"
name: "EmptyBotJSWebApp"
platform: "js"
dependency:
registry: ${{ parameters.dependenciesRegistryJSHosts }}
version: ${{ parameters.dependenciesVersionJSHosts }}
Expand All @@ -164,7 +167,10 @@ stages:
appId: $(BFCFNEMPTYBOTJSFUNCTIONSID)
appSecret: $(BFCFNEMPTYBOTJSFUNCTIONSSECRET)
project:
directory: 'Tests/Functional/Bots/JavaScript/Consumers/CodeFirst/SimpleHostBot'
generator: "generators/generator-bot-empty"
integration: "functions"
name: "EmptyBotJSFunctions"
platform: "js"
dependency:
registry: ${{ parameters.dependenciesRegistryJSHosts }}
version: ${{ parameters.dependenciesVersionJSHosts }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ stages:
jobs:
- job: "Deploy"
variables:
SolutionDir: "$(BUILD.SOURCESDIRECTORY)/bots/"
SolutionDir: "$(BUILD.SOURCESDIRECTORY)/workspace/"
displayName: "Deploy steps"
steps:
# Delete Bot Resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,17 @@ steps:
failOnStderr: true
script: |
# Get Source
$sourceDotNetv3MyGet = "https://botbuilder.myget.org/F/botbuilder-v3-dotnet-daily/api/v3/index.json"
$sourceDotNetArtifacts = "https://pkgs.dev.azure.com/ConversationalAI/BotFramework/_packaging/SDK/nuget/v3/index.json"
$sourceDotNetMyGet = "https://botbuilder.myget.org/F/botbuilder-v4-dotnet-daily/api/v3/index.json"
switch -regex ("${{ parameters.registry }}") {
"^($null|)$" {
switch ("${{ parameters.botType }}") {
"SkillV3" { $source = $sourceDotNetv3MyGet }
default { $source = $sourceDotNetArtifacts }
}
}
"Artifacts" { $source = $sourceDotNetArtifacts }
"MyGet" {
switch ("${{ parameters.botType }}") {
"SkillV3" { $source = $sourceDotNetv3MyGet }
default { $source = $sourceDotNetMyGet }
}
}
Expand All @@ -53,8 +50,6 @@ steps:
if ("${{ parameters.botType }}" -in "Host", "Skill") {
$PackageList = nuget list Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime -Source "$source" -PreRelease
$versionNumber = $PackageList.Split(" ")[-1]
} elseif ("${{ parameters.botType }}" -in "SkillV3") {
$versionNumber = ""
}
}
STABLE { $versionNumber = "" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ parameters:
type: string

steps:
# Create /bots directory
# Create /workspace
- script: |
mkdir bots
displayName: 'Create bots directory'
mkdir workspace
displayName: 'Create workspace directory'

# Install yarn workspace
- script: |
Expand Down
55 changes: 32 additions & 23 deletions tests/functional/build/yaml/deployBotResources/js/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ stages:
dependsOn: "${{ parameters.dependsOn }}"
jobs:
- job: "Deploy"
variables:
SolutionDir: "$(BUILD.SOURCESDIRECTORY)/workspace/"
displayName: "Deploy steps"
steps:
# Delete Bot Resources
Expand All @@ -72,31 +74,19 @@ stages:
botName: "${{ bot.name }}"
keyVault: "${{ parameters.keyVault }}"

# Prepare .env file, deleting all the declared skills, so it uses only the settings define in Azure
- ${{ if eq(bot.type, 'Host') }}:
- task: PowerShell@2
displayName: 'Prepare .env file'
inputs:
targetType: inline
workingDirectory: '$(SYSTEM.DEFAULTWORKINGDIRECTORY)/${{ bot.project.directory }}'
failOnStderr: true
script: |
$file = "./.env"
$content = Get-Content $file
$content | ForEach-Object {
$line = $_
if ($line.Trim().Length -gt 0 -and -not $line.Trim().ToLower().StartsWith('skill_')) {
$line
}
} | Set-Content $file;

# Evaluate dependencies source and version
- template: evaluateDependenciesVariables.yml
parameters:
botType: "${{ bot.type }}"
registry: "${{ bot.dependency.registry }}"
version: "${{ bot.dependency.version }}"

# Generate bot template
- template: ../generator/deploy.yml
parameters:
project: "${{ bot.project }}"
solutiondir: "$(SOLUTIONDIR)"

# Tag BotBuilder version
- template: ../common/tagBotBuilderVersion.yml
parameters:
Expand All @@ -111,7 +101,7 @@ stages:
displayName: 'Set BotBuilder source and version'
inputs:
targetType: inline
workingDirectory: '$(SYSTEM.DEFAULTWORKINGDIRECTORY)/${{ bot.project.directory }}'
workingDirectory: '$(SOLUTIONDIR)/${{ bot.project.name }}'
failOnStderr: true
script: |
$registry = "$(DEPENDENCIESSOURCE)";
Expand Down Expand Up @@ -140,24 +130,35 @@ stages:
displayName: 'Install dependencies'
inputs:
command: 'install'
workingDir: '$(SYSTEM.DEFAULTWORKINGDIRECTORY)/${{ bot.project.directory }}'
workingDir: '$(SOLUTIONDIR)/${{ bot.project.name }}'
customRegistries: 'useNpmrc'
verbose: true

# Prepate bot
# Remove web.config generated from webapp template to be able to run "az bot prepare-deploy"
- ${{ if eq(bot.project.integration, 'webapp') }}:
- task: PowerShell@2
displayName: 'Remove web.config'
inputs:
targetType: inline
workingDirectory: '$(SOLUTIONDIR)/${{ bot.project.name }}'
failOnStderr: true
script: |
Remove-Item .\web.config

# Prepare bot
- task: AzureCLI@2
displayName: 'Prepare Bot'
inputs:
azureSubscription: "${{ parameters.azureSubscription }}"
scriptType: pscore
scriptLocation: inlineScript
inlineScript: 'az bot prepare-deploy --code-dir "${{ bot.project.directory }}" --lang Javascript'
inlineScript: 'az bot prepare-deploy --code-dir "$(SOLUTIONDIR)/${{ bot.project.name }}" --lang Javascript'

# Zip bot
- task: ArchiveFiles@2
displayName: 'Zip bot'
inputs:
rootFolderOrFile: '$(SYSTEM.DEFAULTWORKINGDIRECTORY)/${{ bot.project.directory }}'
rootFolderOrFile: '$(SOLUTIONDIR)/${{ bot.project.name }}'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(SYSTEM.DEFAULTWORKINGDIRECTORY)/build/${{ bot.name }}.zip'
Expand Down Expand Up @@ -216,3 +217,11 @@ stages:
botGroup: "${{ parameters.resourceGroup }}"
botName: "${{ bot.name }}"
resourceSuffix: "${{ parameters.resourceSuffix }}"

# Debugging output for the workspace
- script: |
cd ..
dir *.* /s
displayName: 'Dir workspace'
continueOnError: true
condition: succeededOrFailed()
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ steps:
script: |
# Get Source
$sourceJSMyGet = "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/"
$sourceJSv3MyGet = "https://botbuilder.myget.org/F/botbuilder-v3-js-daily/npm/"
$sourceJSNpm = "https://registry.npmjs.com/"
switch -regex ("${{ parameters.registry }}") {
"^($null|MyGet)$" {
switch ("${{ parameters.botType }}") {
"SkillV3" { $source = $sourceJSv3MyGet }
default { $source = $sourceJSMyGet }
}
}
Expand Down Expand Up @@ -55,9 +53,6 @@ steps:
if ("${{ parameters.botType }}" -in "Host", "Skill") {
$PackageList = npm show botbuilder@* version | Out-String;
}
elseif ("${{ parameters.botType }}" -in "SkillV3") {
$PackageList = npm show botbuilder@3.* version | Out-String;
}
$versionNumber = ($PackageList.Split(" ")[-1]).Trim().TrimStart("'").TrimEnd("'");
}
default { $versionNumber = "${{ parameters.version }}" }
Expand Down