|
| 1 | +name: $(BuildID)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) |
| 2 | + |
| 3 | +resources: |
| 4 | + repositories: |
| 5 | + - repository: Device-Lab |
| 6 | + type: git |
| 7 | + endpoint: azure-iot-dde |
| 8 | + name: Device-Lab/Device-Lab |
| 9 | + |
| 10 | +trigger: |
| 11 | + batch: true |
| 12 | + branches: |
| 13 | + include: |
| 14 | + - master |
| 15 | + paths: |
| 16 | + exclude: |
| 17 | + - doc/* |
| 18 | + |
| 19 | +jobs: |
| 20 | +- job: STM_Build |
| 21 | + pool: |
| 22 | + name: 'DDE' |
| 23 | + demands: |
| 24 | + - STMBL4S5IIOT01A -equals true |
| 25 | + steps: |
| 26 | + - checkout: self |
| 27 | + clean: true |
| 28 | + submodules: recursive |
| 29 | + - checkout: Device-Lab |
| 30 | + clean: true |
| 31 | + |
| 32 | + # Azure CLI to start certification |
| 33 | + - task: AzureCLI@2 |
| 34 | + inputs: |
| 35 | + azureSubscription: 'IoT-DDE-team-subscription' |
| 36 | + scriptType: 'ps' |
| 37 | + scriptLocation: 'scriptPath' |
| 38 | + scriptPath: '$(Build.SourcesDirectory)\Device-Lab\generate_creds.ps1' |
| 39 | + arguments: '$(Build.SourcesDirectory)\getting-started\core\model' |
| 40 | + useGlobalConfig: true |
| 41 | + displayName: "Start Certification" |
| 42 | + |
| 43 | + # modify config with credentials |
| 44 | + - task: PowerShell@2 |
| 45 | + inputs: |
| 46 | + targetType: 'filePath' |
| 47 | + filePath: '$(Build.SourcesDirectory)\Device-Lab\update_config.ps1' |
| 48 | + arguments: > # Use this to avoid newline characters in multiline string |
| 49 | + -ConfigFilePath '$(Build.SourcesDirectory)\getting-started\STMicroelectronics\STM32L4_L4+\app\azure_config.h' |
| 50 | + displayName: 'Modify config file' |
| 51 | + |
| 52 | + # Build binary |
| 53 | + - script: | |
| 54 | + echo %PATH% |
| 55 | + cd $(Build.SourcesDirectory)\getting-started\STMicroelectronics\STM32L4_L4+\tools |
| 56 | + .\rebuild.bat |
| 57 | + displayName: "Build Binary" |
| 58 | +
|
| 59 | + # Flash binary to hardware |
| 60 | + - task: PowerShell@2 |
| 61 | + inputs: |
| 62 | + targetType: 'filePath' |
| 63 | + filePath: '$(Build.SourcesDirectory)\Device-Lab\flashing_tools\flash-board.ps1' |
| 64 | + arguments: > # Use this to avoid newline characters in multiline string |
| 65 | + -BinPath '$(Build.SourcesDirectory)\getting-started\STMicroelectronics\STM32L4_L4+\build\app\stm32l4S5_azure_iot.hex' |
| 66 | + displayName: 'Flash binary' |
| 67 | + |
| 68 | + # Monitor device for successful connection to Iot Hub |
| 69 | + - task: PowerShell@2 |
| 70 | + inputs: |
| 71 | + targetType: 'filePath' |
| 72 | + filePath: '$(Build.SourcesDirectory)\Device-Lab\scan_serial.ps1' |
| 73 | + arguments: > # Use this to avoid newline characters in multiline string |
| 74 | + -TestString 'SUCCESS: Azure IoT Hub client initialized' |
| 75 | + displayName: 'Scan serial port' |
| 76 | + |
| 77 | + # Azure CLI to run certification |
| 78 | + - task: AzureCLI@2 |
| 79 | + inputs: |
| 80 | + azureSubscription: 'IoT-DDE-team-subscription' |
| 81 | + scriptType: 'ps' |
| 82 | + scriptLocation: 'scriptPath' |
| 83 | + scriptPath: '$(Build.SourcesDirectory)\Device-Lab\run_certification.ps1' |
| 84 | + arguments: $(TESTID) |
| 85 | + useGlobalConfig: true |
| 86 | + displayName: "Run Certification" |
0 commit comments