onnxruntime/tools/ci_build/github/azure-pipelines/templates/telemetry-steps.yml
edgchen1 71d8846635
Fix telemetry-steps.yml (#4903)
Fix bug in telemetry-steps.yml that causes telemetry setup to be disabled even if TELEMETRYGUID is set.
2020-08-24 22:14:40 -07:00

19 lines
982 B
YAML

# sets the TelemetryOption variable and optionally generates TraceLoggingConfigPrivate.h based on the TELEMETRYGUID
# variable
steps:
- powershell: |
if ($env:TELEMETRYGUID) {
$length = $env:TELEMETRYGUID.length
$fileContent = "#define TraceLoggingOptionMicrosoftTelemetry() \
TraceLoggingOptionGroup("+$env:TELEMETRYGUID.substring(1, $length-2)+")"
New-Item -Path "$(Build.SourcesDirectory)\include\onnxruntime\core\platform\windows\TraceLoggingConfigPrivate.h" -ItemType "file" -Value "$fileContent" -Force
Write-Host "##vso[task.setvariable variable=TelemetryOption]--use_telemetry"
Write-Host "Telemetry is enabled."
} else {
Write-Host "##vso[task.setvariable variable=TelemetryOption]"
Write-Host "Telemetry is disabled."
}
displayName: 'Set TelemetryOption variable and optionally create TraceLoggingConfigPrivate.h for WinML Telemetry'
env:
TELEMETRYGUID: $(TELEMETRYGUID)