File size: 1,728 Bytes
0827183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#
# Run functional test on bot deployed to a Docker Linux environment in Azure.
#
pool:
  vmImage: 'Ubuntu-16.04'

trigger: # ci trigger
  branches:
    include:
     - master

pr: none # no pr trigger

variables:
  # Container registry service connection established during pipeline creation
  dockerRegistryServiceConnection: 'NightlyE2E-Acr'
  azureRmServiceConnection: 'NightlyE2E-RM'
  dockerFilePath: 'libraries/functional-tests/functionaltestbot/Dockerfile'
  buildIdTag: $(Build.BuildNumber)
  webAppName: 'e2epython'
  containerRegistry: 'nightlye2etest.azurecr.io'
  imageRepository: 'functionaltestpy'
  # LinuxTestBotAppId: get this from azure
  # LinuxTestBotAppSecret: get this from Azure

jobs:
- job: Build
  displayName: Build and push bot image
  continueOnError: false
  steps:
  - task: Docker@2
    displayName: Build and push bot image
    inputs:
      command: buildAndPush
      repository: $(imageRepository)
      dockerfile: $(dockerFilePath)
      containerRegistry: $(dockerRegistryServiceConnection)
      tags: $(buildIdTag)

- job: Deploy
  displayName: Provision bot container
  dependsOn:
  - Build
  steps:
  - task: AzureRMWebAppDeployment@4
    displayName: Python Functional E2E test.
    inputs:
      ConnectionType: AzureRM
      ConnectedServiceName: $(azureRmServiceConnection)
      appType: webAppContainer
      WebAppName: $(webAppName)
      DockerNamespace: $(containerRegistry)
      DockerRepository: $(imageRepository)
      DockerImageTag: $(buildIdTag)
      AppSettings: '-MicrosoftAppId $(LinuxTestBotAppId) -MicrosoftAppPassword $(LinuxTestBotAppSecret) -FLASK_APP /functionaltestbot/app.py -FLASK_DEBUG 1'

      #StartupCommand: 'flask run --host=0.0.0.0 --port=3978'