forked from eclipse-threadx/getting-started
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
86 lines (77 loc) · 2.56 KB
/
azure-pipelines.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: $(BuildID)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
resources:
repositories:
- repository: Device-Lab
type: git
endpoint: azure-iot-dde
name: Device-Lab/Device-Lab
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- doc/*
jobs:
- job: MXCHIP_Build
pool:
name: 'DDE'
demands:
- MXCHIPAZ3166 -equals true
steps:
- checkout: self
clean: true
submodules: recursive
- checkout: Device-Lab
clean: true
# Azure CLI to start certification
- task: AzureCLI@2
inputs:
azureSubscription: 'ExpressLogicDeviceLabResourceManagerSC'
scriptType: 'ps'
scriptLocation: 'scriptPath'
scriptPath: '$(Build.SourcesDirectory)\Device-Lab\generate_creds.ps1'
arguments: '$(Build.SourcesDirectory)\getting-started\shared\model'
useGlobalConfig: true
displayName: "Start Certification"
# modify config with credentials
- task: PowerShell@2
inputs:
targetType: 'filePath'
filePath: '$(Build.SourcesDirectory)\Device-Lab\update_config.ps1'
arguments: > # Use this to avoid newline characters in multiline string
-ConfigFilePath '$(Build.SourcesDirectory)\getting-started\MXChip\AZ3166\app\azure_config.h'
displayName: 'Modify config file'
# Build binary
- script: |
echo %PATH%
cd $(Build.SourcesDirectory)\getting-started\MXChip\AZ3166\tools
.\rebuild.bat
displayName: "Build Binary"
# Flash binary to hardware
- task: PowerShell@2
inputs:
targetType: 'filePath'
filePath: '$(Build.SourcesDirectory)\Device-Lab\flashing_tools\flash-board.ps1'
arguments: > # Use this to avoid newline characters in multiline string
-BinPath '$(Build.SourcesDirectory)\getting-started\MXChip\AZ3166\build\app\mxchip_azure_iot.hex'
displayName: 'Flash binary'
# Monitor device for successful connection to Iot Hub
- task: PowerShell@2
inputs:
targetType: 'filePath'
filePath: '$(Build.SourcesDirectory)\Device-Lab\scan_serial.ps1'
arguments: > # Use this to avoid newline characters in multiline string
-TestString 'SUCCESS: Connected to IoT Hub'
displayName: 'Scan serial port'
# Azure CLI to run certification
- task: AzureCLI@2
inputs:
azureSubscription: 'ExpressLogicDeviceLabResourceManagerSC'
scriptType: 'ps'
scriptLocation: 'scriptPath'
scriptPath: '$(Build.SourcesDirectory)\Device-Lab\run_certification.ps1'
arguments: $(TESTID)
useGlobalConfig: true
displayName: "Run Certification"