Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scripts and YML to use "Agent.OS" instead of custom variables like "OSVmImage" #5494

Open
mikeharder opened this issue Feb 17, 2023 · 3 comments
Assignees
Labels
Central-EngSys This issue is owned by the Engineering System team.

Comments

@mikeharder
Copy link
Member

I believe many of our scripts and YML use custom variables like OSVmImage to detect operating system. However, I think it might be better to use the built-in variable Agent.OS instead.

image

https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#agent-variables-devops-services

@mikeharder mikeharder added the Central-EngSys This issue is owned by the Engineering System team. label Feb 17, 2023
@danieljurek
Copy link
Member

We can also use $IsWindows, $IsLinux, etc. in PowerShell but I want to make sure that we get the "marketing" version of the platform, e.g. Windows Server 2022 vs. Windows_NT

We were using the OS vm image as a way to discover that information without having to query the OS and then work backwards toward a version. It might make sense to parse $PSVersionTable.OS but we'll have to see how that works in the various OS' we use. It hasn't been investigated yet.

@mikeharder
Copy link
Member Author

@danieljurek: Are you saying we have cases where we want to know the OS version (e.g. Windows 2019 vs Windows 2022), rather than just Windows vs Linux vs Mac? In that case, I agree OSVmImage might be preferable to Agent.OS.

But I also know we have code that maps OSVmImage to one of the three operating systems, and I think that code could be replaced by Agent.OS.

@danieljurek
Copy link
Member

Correct, we try to put the OS marketing version in the output: https://github.com/Azure/azure-sdk-for-cpp/blob/main/eng/scripts/Get-BinarySizes.ps1#L56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central-EngSys This issue is owned by the Engineering System team.
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants