Skip to content

Commit

Permalink
Fix Samples E2E test pipelines for Azure linux deploys (microsoft#3817)
Browse files Browse the repository at this point in the history
* Update py YAML files

* Update templates

* Update templates 2

* Fix typo in templates

* Update JS linux pipelines & deploymentTemplates

* Update pipelines and templates for dotnet linux deploy

* Fix dotnet linux corebot template

* Fix dotnet linux template 2

* Fix dotnet linux template 3

* Fix dotnet linux template 4

* Fix DotNet linux template 5

* Clean up dotnet linux template

* Fix dotnet linux new template

* Let yaml do new template

* Fix json format

* More fixes to dotnet linux new RG template

* Restore AzureCLI@2 tasks

* Fix dotnet echobot templates

* Update yaml for TS

* Update linux templates for TS

* Fix typescript corebot linux template

* Fix py zipdeploy yaml

* Force ts yaml to use preexisting RG template

* Add apptype param to ts template

* Fix ts json

* Fix js template format

* More TS template fixes

* Fix ts echobot linux template

* Fix ts corebot withnew template

* ts yaml switch to new

* Fix ts echobot withnew

* Update js corebot withnew

* Fix js linux

* Fix typo in withnew templates

* Update parameters

* Clean up ts linux yaml

* Reformat readmes, fix templates

* Fix 2 readmes
  • Loading branch information
BruceHaley authored Sep 12, 2022
1 parent bb38c78 commit b57fa7b
Show file tree
Hide file tree
Showing 401 changed files with 31,311 additions and 28,670 deletions.
46 changes: 36 additions & 10 deletions build/yaml/sample-dotnet-samplebot-linux-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,22 +269,48 @@ jobs:
modifyOutputPath: false

- task: AzureCLI@2
displayName: 'Preexisting RG: create group, create resources, #prepare .deployment file'
displayName: 'Preexisting RG: create Azure resources. Runs in even builds.'
inputs:
azureSubscription: 'FUSE Temporary'
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
Set-PSDebug -Trace 1;
az group create --location westus --name $(BotGroup)

# set up bot channels registration, app service plan
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\LinuxDotNet\template.json" --parameters appId="$(AppId)" appSecret="$(AppSecret)" botName="$(AzureBotName)" --name "$(AzureBotName)";

#az bot prepare-deploy --lang Csharp --code-dir "$(SampleRootPath)" --proj-file-path "$(SampleBotName).csproj";
Write-Host "`n***** Creating Azure resources using the preexisting-rg template *****";
Write-Host "This task runs for even-numbered builds. Build ID = $(Build.BuildId)";
Write-Host "************************************************************************";
Set-PSDebug -Trace 1;
az group create --location westus --name $(BotGroup);
# set up app service plan, app service (web app)
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\linux\DeployUseExistResourceGroup\template-BotApp-with-rg.json" --parameters appId="$(AppId)" appSecret="$(AppSecret)" appServiceName="$(AzureBotName)" newAppServicePlanName="$(AzureBotName)" newAppServicePlanLocation="westus" --name "$(AzureBotName)";
# set up bot channels registration
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\linux\DeployUseExistResourceGroup\template-AzureBot-with-rg.json" --parameters appId="$(AppId)" azureBotId="$(AzureBotName)";
Set-PSDebug -Trace 0;
condition: and(succeeded(), or( endsWith(variables['Build.BuildId'], 0), endsWith(variables['Build.BuildId'], 2), endsWith(variables['Build.BuildId'], 4), endsWith(variables['Build.BuildId'], 6), endsWith(variables['Build.BuildId'], 8)))

- task: AzureCLI@2
displayName: 'New RG: create Azure resources. Runs in odd builds.'
inputs:
azureSubscription: 'FUSE Temporary'
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
Write-Host "`n***** Creating Azure resources using the new-rg template *****";
Write-Host "This task runs for odd-numbered builds. Build ID = $(Build.BuildId)";
Write-Host "****************************************************************";
Set-PSDebug -Trace 1;
# set up resource group, app service plan, app service (web app)
az deployment sub create --name "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\linux\DeployWithNewResourceGroup\template-BotApp-new-rg.json" --location "westus" --parameters appId=$(AppId) appSecret="$(AppSecret)" appServiceName="$(AzureBotName)" appServicePlanName="$(AzureBotName)" groupName="$(BotGroup)" groupLocation="westus" appServicePlanLocation="westus";
Set-PSDebug -Trace 0;
# set up bot channels registration
az deployment sub create --name "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\linux\DeployWithNewResourceGroup\template-AzureBot-new-rg.json" --location "westus" --parameters appId=$(AppId) azureBotId="$(AzureBotName)" groupName="$(BotGroup)" groupLocation="westus";

Set-PSDebug -Trace 0;
condition: and(succeeded(), or( endsWith(variables['Build.BuildId'], 1), endsWith(variables['Build.BuildId'], 3), endsWith(variables['Build.BuildId'], 5), endsWith(variables['Build.BuildId'], 7), endsWith(variables['Build.BuildId'], 9)))

- powershell: |
Set-PSDebug -Trace 1;
Expand Down
48 changes: 36 additions & 12 deletions build/yaml/sample-js-samplebot-linux-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,23 +173,48 @@ jobs:
verbose: false

- task: AzureCLI@2
displayName: 'create group, create resources, generate web.config (uses dotnet template)'
displayName: 'Preexisting RG: create Azure resources. Runs in even builds.'
inputs:
azureSubscription: 'FUSE Temporary'
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
Write-Host "`n***** Creating Azure resources using the preexisting-rg template *****";
Write-Host "This task runs for even-numbered builds. Build ID = $(Build.BuildId)";
Write-Host "************************************************************************";
Set-PSDebug -Trace 1;
az group create --location westus --name $(BotGroup);
# set up app service plan, app service (web app)
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\linux\DeployUseExistResourceGroup\template-BotApp-with-rg.json" --parameters appId="$(AppId)" appSecret="$(AppSecret)" appServiceName="$(AzureBotName)" newAppServicePlanName="$(AzureBotName)" newAppServicePlanLocation="westus" --name "$(AzureBotName)";
# set up bot channels registration
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\linux\DeployUseExistResourceGroup\template-AzureBot-with-rg.json" --parameters appId="$(AppId)" azureBotId="$(AzureBotName)";
Set-PSDebug -Trace 0;
condition: and(succeeded(), or( endsWith(variables['Build.BuildId'], 0), endsWith(variables['Build.BuildId'], 2), endsWith(variables['Build.BuildId'], 4), endsWith(variables['Build.BuildId'], 6), endsWith(variables['Build.BuildId'], 8)))

- task: AzureCLI@2
displayName: 'New RG: create Azure resources. Runs in odd builds.'
inputs:
azureSubscription: 'FUSE Temporary'
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
Write-Host "`n***** Creating Azure resources using the new-rg template *****";
Write-Host "This task runs for odd-numbered builds. Build ID = $(Build.BuildId)";
Write-Host "****************************************************************";
Set-PSDebug -Trace 1;
# set up resource group, app service plan, app service (web app)
az deployment sub create --name "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\linux\DeployWithNewResourceGroup\template-BotApp-new-rg.json" --location "westus" --parameters appId=$(AppId) appSecret="$(AppSecret)" appServiceName="$(AzureBotName)" appServicePlanName="$(AzureBotName)" groupName="$(BotGroup)" groupLocation="westus" appServicePlanLocation="westus";
# set up bot channels registration, app service plan
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\deploymentTemplates\linux\template.json" --parameters appId="$(AppId)" appSecret="$(AppSecret)" botName="$(AzureBotName)" --name "$(AzureBotName)";

# Generate web.config for bot deploy
az bot prepare-deploy --code-dir "$(SampleRootPath)" --lang Javascript

# set up bot channels registration
az deployment sub create --name "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\linux\DeployWithNewResourceGroup\template-AzureBot-new-rg.json" --location "westus" --parameters appId=$(AppId) azureBotId="$(AzureBotName)" groupName="$(BotGroup)" groupLocation="westus";

Set-PSDebug -Trace 0;
condition: and(succeeded(), or( endsWith(variables['Build.BuildId'], 1), endsWith(variables['Build.BuildId'], 3), endsWith(variables['Build.BuildId'], 5), endsWith(variables['Build.BuildId'], 7), endsWith(variables['Build.BuildId'], 9)))

- powershell: |
Set-PSDebug -Trace 1;
Expand All @@ -203,14 +228,14 @@ jobs:
git config --global user.name "SampleJs$(SampleBotName)LinuxTestPipeline"
git config --global user.email [email protected]
git init
git add .
git commit -m "Add bot source code"
git remote add azure https://$(AzureDeploymentUser):$(AzureDeploymentPassword)@$(AzureBotName).scm.azurewebsites.net:443/$(AzureBotName).git
git push azure master
workingDirectory: '$(System.DefaultWorkingDirectory)/samples/javascript_nodejs/$(SampleFolderName)'
displayName: 'Deploy the bot to Azure'
displayName: 'Git push the bot to Azure'
- task: AzureCLI@2
displayName: Create DirectLine channel
Expand Down Expand Up @@ -302,5 +327,4 @@ jobs:
Set-PSDebug -Trace 0;
condition: and(succeededOrFailed(), ne(variables['DeleteResourceGroup'], 'false'))
continueOnError: True

...
69 changes: 35 additions & 34 deletions build/yaml/sample-py-samplebot-linux-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,17 +308,20 @@ jobs:
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
Write-Host "`n***** Creating Azure resources using the preexisting-rg template *****";
Write-Host "This task runs for even-numbered builds. Build ID = $(Build.BuildId)";
Write-Host "************************************************************************";
#Set-PSDebug -Trace 1;
az group create --location westus --name $(BotGroup);
# set up bot channels registration, app service, app service plan
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="$(AzureBotName)" appId="$(AppId)" appSecret="$(AppSecret)" newAppServicePlanName="$(AzureBotName)" appServicePlanLocation="westus" --name "$(AzureBotName)";
Write-Host "`n***** Creating Azure resources using the preexisting-rg template *****";
Write-Host "This task runs for even-numbered builds. Build ID = $(Build.BuildId)";
Write-Host "************************************************************************";
Set-PSDebug -Trace 1;
az group create --location westus --name $(BotGroup);
# set up app service plan, app service (web app)
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\DeployUseExistResourceGroup\template-BotApp-with-rg.json" --parameters appId="$(AppId)" appSecret="$(AppSecret)" appServiceName="$(AzureBotName)" newAppServicePlanName="$(AzureBotName)" newAppServicePlanLocation="westus" --name "$(AzureBotName)";
#Set-PSDebug -Trace 0;
# set up bot channels registration
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\DeployUseExistResourceGroup\template-AzureBot-with-rg.json" --parameters appId="$(AppId)" azureBotId="$(AzureBotName)";
Set-PSDebug -Trace 0;
condition: and(succeeded(), or( endsWith(variables['Build.BuildId'], 0), endsWith(variables['Build.BuildId'], 2), endsWith(variables['Build.BuildId'], 4), endsWith(variables['Build.BuildId'], 6), endsWith(variables['Build.BuildId'], 8)))

- task: AzureCLI@2
Expand All @@ -331,42 +334,40 @@ jobs:
Write-Host "`n***** Creating Azure resources using the new-rg template *****";
Write-Host "This task runs for odd-numbered builds. Build ID = $(Build.BuildId)";
Write-Host "****************************************************************";
Set-PSDebug -Trace 1;
#Set-PSDebug -Trace 1;
# set up resource group, bot channels registration, app service, app service plan
az deployment sub create --name "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\template-with-new-rg.json" --location "westus" --parameters appId=$(AppId) appSecret="$(AppSecret)" botId="$(AzureBotName)" botSku=S1 newAppServicePlanName="$(AzureBotName)" newWebAppName="$(AzureBotName)" groupName="$(BotGroup)" groupLocation="westus" newAppServicePlanLocation="westus";
# set up resource group, app service plan, app service (web app)
az deployment sub create --name "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\DeployWithNewResourceGroup\template-BotApp-new-rg.json" --location "westus" --parameters appId=$(AppId) appSecret="$(AppSecret)" appServiceName="$(AzureBotName)" appServicePlanName="$(AzureBotName)" groupName="$(BotGroup)" groupLocation="westus" appServicePlanLocation="westus";
# set up bot channels registration
az deployment sub create --name "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\DeployWithNewResourceGroup\template-AzureBot-new-rg.json" --location "westus" --parameters appId=$(AppId) azureBotId="$(AzureBotName)" groupName="$(BotGroup)" groupLocation="westus";

#Set-PSDebug -Trace 0;
Set-PSDebug -Trace 0;
condition: and(succeeded(), or( endsWith(variables['Build.BuildId'], 1), endsWith(variables['Build.BuildId'], 3), endsWith(variables['Build.BuildId'], 5), endsWith(variables['Build.BuildId'], 7), endsWith(variables['Build.BuildId'], 9)))

- script: |
echo on
git config --global user.name "SamplePy$(SampleBotName)LinuxTestPipeline"
git config --global user.email [email protected]
git init
git add .
git commit -m "Add bot source code"
git remote add azure https://$(AzureDeploymentUser):$(AzureDeploymentPassword)@$(AzureBotName).scm.azurewebsites.net:443/$(AzureBotName).git
git push azure master
workingDirectory: '$(SampleRootPath)'
displayName: 'Git push the bot to Azure'
- task: AzureCLI@2
displayName: Create directline channel
displayName: Create DirectLine channel
inputs:
azureSubscription: 'FUSE Temporary'
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
az bot directline create --name "$(AzureBotName)" --resource-group "$(BotGroup)" > "$(System.DefaultWorkingDirectory)\DirectLineCreate.json" --debug
#az webapp deployment source config-zip --resource-group "$(BotGroup)" --name "$(AzureBotName)" --src "$(SampleRootPath)\testbot.zip" --debug
- script: |
echo git config
git config --global user.name "SamplePy$(SampleBotName)LinuxTestPipeline"
git config --global user.email [email protected]
git init
echo git add .
git add .
git commit -m "Add bot source code"
git remote add azure https://$(AzureDeploymentUser):$(AzureDeploymentPassword)@$(AzureBotName).scm.azurewebsites.net:443/$(AzureBotName).git
echo git push azure master
git push azure master
workingDirectory: '$(SampleRootPath)'
displayName: 'git push the bot to Azure'
- powershell: |
# Key = Direct Line channel "Secret keys" in Azure portal
$json = Get-Content '$(System.DefaultWorkingDirectory)\DirectLineCreate.json' | Out-String | ConvertFrom-Json;
Expand Down
35 changes: 20 additions & 15 deletions build/yaml/sample-py-zipdeploy-echobot-linux-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,42 +308,47 @@ jobs:

- task: AzureCLI@2
displayName: 'Preexisting RG: create Azure resources. Runs in even builds.'
enabled: False
inputs:
azureSubscription: 'FUSE Temporary'
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
Write-Host "`n***** Creating Azure resources using the preexisting-rg template *****";
Write-Host "This task runs for even-numbered builds. Build ID = $(Build.BuildId)";
Write-Host "************************************************************************";
#Set-PSDebug -Trace 1;
az group create --location westus --name $(BotGroup);
Write-Host "`n***** Creating Azure resources using the preexisting-rg template *****";
Write-Host "This task runs for even-numbered builds. Build ID = $(Build.BuildId)";
Write-Host "************************************************************************";
Set-PSDebug -Trace 1;
az group create --location westus --name $(BotGroup);
# set up bot channels registration, app service, app service plan
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="$(AzureBotName)" appId="$(AppId)" appSecret="$(AppSecret)" newAppServicePlanName="$(AzureBotName)" appServicePlanLocation="westus" --name "$(AzureBotName)";
# set up app service plan, app service (web app)
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\DeployUseExistResourceGroup\template-BotApp-with-rg.json" --parameters appId="$(AppId)" appSecret="$(AppSecret)" appServiceName="$(AzureBotName)" newAppServicePlanName="$(AzureBotName)" newAppServicePlanLocation="westus" --name "$(AzureBotName)";

# set up bot channels registration
az deployment group create --resource-group "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\DeployUseExistResourceGroup\template-AzureBot-with-rg.json" --parameters appId="$(AppId)" azureBotId="$(AzureBotName)";

#Set-PSDebug -Trace 0;
Set-PSDebug -Trace 0;
condition: and(succeeded(), or( endsWith(variables['Build.BuildId'], 0), endsWith(variables['Build.BuildId'], 2), endsWith(variables['Build.BuildId'], 4), endsWith(variables['Build.BuildId'], 6), endsWith(variables['Build.BuildId'], 8)))

- task: AzureCLI@2
displayName: 'New RG: create Azure resources. '
displayName: 'New RG: create Azure resources. Runs in odd builds.'
inputs:
azureSubscription: 'FUSE Temporary'
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
Write-Host "`n***** Creating Azure resources using the new-rg template *****";
Write-Host "This task runs for odd-numbered builds. Build ID = $(Build.BuildId)";
Write-Host "****************************************************************";
Set-PSDebug -Trace 1;
# set up resource group, bot channels registration, app service, app service plan
az deployment sub create --name "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\template-with-new-rg.json" --location "westus" --parameters appId=$(AppId) appSecret="$(AppSecret)" botId="$(AzureBotName)" botSku=S1 newAppServicePlanName="$(AzureBotName)" newWebAppName="$(AzureBotName)" groupName="$(BotGroup)" groupLocation="westus" newAppServicePlanLocation="westus";
# set up resource group, app service plan, app service (web app)
az deployment sub create --name "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\DeployWithNewResourceGroup\template-BotApp-new-rg.json" --location "westus" --parameters appId=$(AppId) appSecret="$(AppSecret)" appServiceName="$(AzureBotName)" appServicePlanName="$(AzureBotName)" groupName="$(BotGroup)" groupLocation="westus" appServicePlanLocation="westus";
# set up bot channels registration
az deployment sub create --name "$(BotGroup)" --template-file "$(SampleRootPath)\DeploymentTemplates\DeployWithNewResourceGroup\template-AzureBot-new-rg.json" --location "westus" --parameters appId=$(AppId) azureBotId="$(AzureBotName)" groupName="$(BotGroup)" groupLocation="westus";

Set-PSDebug -Trace 0;
condition: and(succeeded(), or( endsWith(variables['Build.BuildId'], 1), endsWith(variables['Build.BuildId'], 3), endsWith(variables['Build.BuildId'], 5), endsWith(variables['Build.BuildId'], 7), endsWith(variables['Build.BuildId'], 9)))

- task: AzureCLI@2
displayName: Create directline channel
Expand Down
Loading

0 comments on commit b57fa7b

Please sign in to comment.