diff --git a/tests/functional/build/yaml/deployBotResources/deployBotResources.yml b/tests/functional/build/yaml/deployBotResources/deployBotResources.yml index f39e345b58..bcd2504288 100644 --- a/tests/functional/build/yaml/deployBotResources/deployBotResources.yml +++ b/tests/functional/build/yaml/deployBotResources/deployBotResources.yml @@ -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 }} @@ -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 }} diff --git a/tests/functional/build/yaml/deployBotResources/dotnet/deploy.yml b/tests/functional/build/yaml/deployBotResources/dotnet/deploy.yml index f3d0c6f054..d7084aa0ad 100644 --- a/tests/functional/build/yaml/deployBotResources/dotnet/deploy.yml +++ b/tests/functional/build/yaml/deployBotResources/dotnet/deploy.yml @@ -55,7 +55,7 @@ stages: jobs: - job: "Deploy" variables: - SolutionDir: "$(BUILD.SOURCESDIRECTORY)/bots/" + SolutionDir: "$(BUILD.SOURCESDIRECTORY)/workspace/" displayName: "Deploy steps" steps: # Delete Bot Resources diff --git a/tests/functional/build/yaml/deployBotResources/dotnet/evaluateDependenciesVariables.yml b/tests/functional/build/yaml/deployBotResources/dotnet/evaluateDependenciesVariables.yml index f2e44169c4..e1fb2c57a8 100644 --- a/tests/functional/build/yaml/deployBotResources/dotnet/evaluateDependenciesVariables.yml +++ b/tests/functional/build/yaml/deployBotResources/dotnet/evaluateDependenciesVariables.yml @@ -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 } } } @@ -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 = "" } diff --git a/tests/functional/build/yaml/deployBotResources/generator/deploy.yml b/tests/functional/build/yaml/deployBotResources/generator/deploy.yml index f7c1680fde..a061e1677f 100644 --- a/tests/functional/build/yaml/deployBotResources/generator/deploy.yml +++ b/tests/functional/build/yaml/deployBotResources/generator/deploy.yml @@ -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: | diff --git a/tests/functional/build/yaml/deployBotResources/js/deploy.yml b/tests/functional/build/yaml/deployBotResources/js/deploy.yml index 497994cda4..a8994dc8b8 100644 --- a/tests/functional/build/yaml/deployBotResources/js/deploy.yml +++ b/tests/functional/build/yaml/deployBotResources/js/deploy.yml @@ -53,6 +53,8 @@ stages: dependsOn: "${{ parameters.dependsOn }}" jobs: - job: "Deploy" + variables: + SolutionDir: "$(BUILD.SOURCESDIRECTORY)/workspace/" displayName: "Deploy steps" steps: # Delete Bot Resources @@ -72,24 +74,6 @@ 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: @@ -97,6 +81,12 @@ stages: 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: @@ -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)"; @@ -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' @@ -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() \ No newline at end of file diff --git a/tests/functional/build/yaml/deployBotResources/js/evaluateDependenciesVariables.yml b/tests/functional/build/yaml/deployBotResources/js/evaluateDependenciesVariables.yml index fc47b0302e..67dc8ef7a7 100644 --- a/tests/functional/build/yaml/deployBotResources/js/evaluateDependenciesVariables.yml +++ b/tests/functional/build/yaml/deployBotResources/js/evaluateDependenciesVariables.yml @@ -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 } } } @@ -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 }}" }