-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathazure-pipeline.yaml
101 lines (91 loc) · 3.6 KB
/
azure-pipeline.yaml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
resources:
repositories:
- repository: DevCentral/ni-central
type: git
name: ni-central
parameters:
- name: rtos_oetest_locked_pr_build
displayName: 'rtos-oetest-locked PR build number (default: empty)'
type: string
default: ' '
variables:
- name: BRANCH_NAME
value: $[replace(variables['Build.SourceBranch'], 'refs/heads/', '')]
- name: ParamsOutputFile
value: $(Build.SourcesDirectory)\snac_pr_params.yaml
- name: CompiledMobilizePlan
value: $(Agent.TempDirectory)/compile_mobilize_plan.yaml
- template: /src/rtos/pipeline/version.yml@DevCentral/ni-central
pr:
paths:
exclude:
- .github/*
- .vs/*
branches:
include:
- master
pool:
name: Drivers-NIBuildFarm-RFMIBUILD
demands:
- agent.os -equals Windows_NT
- python3
stages:
- stage: BuildInformation
jobs:
- job: BuildInformation
steps:
- powershell: |
if ("$(Build.Reason)" -eq "Manual") {
Write-Host "The pipeline was triggered manually."
} elseif ("$(Build.Reason)" -eq "PullRequest") {
Write-Host "The pipeline was triggered by a pull request."
} else {
Write-Host "The pipeline was triggered by another reason: $(Build.Reason)"
}
displayName: CheckTriggerReason
- powershell: |
echo "Hello, world!"
echo "Build number: $(Build.BuildNumber)"
echo "Build ID: $(Build.BuildID)"
echo "Build Reason: $(Build.Reason)"
echo "Build Sources Directory: $(Build.SourcesDirectory)"
echo "Build SourceBranch: $(BRANCH_NAME)"
echo "REPO_EXTERNAL_VERSION_NOSPACE: $(REPO_EXTERNAL_VERSION_NOSPACE)"
if ("$(Build.Reason)" -eq "PullRequest") {
echo "Pull Request ID: $(System.PullRequest.PullRequestId)"
echo "Pull Request Source Branch: $(System.PullRequest.SourceBranch)"
echo "Pull Request Target Branch: $(System.PullRequest.TargetBranch)"
}
displayName: PrintBuildInformation
- stage: SanityTests
# Only allow one instance of this stage to run at a time to avoid resource contention issues with the targets used in testing.
lockBehavior: sequential
dependsOn:
- BuildInformation
jobs:
- job: SanityTests
continueOnError: false
steps:
- template: /eng/pipeline/python/templates/setup-venv.yml@DevCentral/ni-central
parameters:
venvName: test_venv
${{ if ne(parameters.rtos_oetest_locked_pr_build, ' ') }}:
pipPkgs:
- rtos-oetest-locked==${{ parameters.rtos_oetest_locked_pr_build }}
usePRServer: true
${{ else }}:
pipPkgs:
- rtos-oetest-locked
- powershell: |
$(test_venv.bin_dir)/mako-render $(test_venv.bin_dir)\..\Lib\site-packages\rtos_oetest\mobilize_plans\rtos_oetest\snac\pr\snac_pr_params.yaml.makoo --var majmin_ver="$(Version.Distribution)" --var REPO_VERSION="$(REPO_EXTERNAL_VERSION)" --var REPO_ROOT="$(Build.SourcesDirectory)" --var REPO_EXTERNAL_VERSION_NOSPACE="$(REPO_EXTERNAL_VERSION_NOSPACE)" --output-file $(ParamsOutputFile)
displayName: Mako Render Mobilize Params File
- powershell: |
cat $(ParamsOutputFile)
displayName: Display Mobilize Params File
- powershell: |
$(test_venv.bin_dir)/mobilize -vv execute -p $(test_venv.bin_dir)\..\Lib\site-packages\rtos_oetest\mobilize_plans\rtos_oetest\snac\pr\snac_pr_provision_and_test.yaml.mako -a $(ParamsOutputFile) -o $(CompiledMobilizePlan)
displayName: Execute Mobilize Plan