forked from Azure/azure-sdk-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef37a0c
commit 3d0c779
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Script verifies the operating system for the platform on which it is being run | ||
# Used in build pipelines to verify the build agent os | ||
# Variable: The name of the os to verfy against | ||
|
||
import sys | ||
import platform | ||
osparameter = sys.argv[1] | ||
print ("Parameter passed by matrix -", osparameter) | ||
osparameter = 'Darwin' if(osparameter.lower() == 'MacOS'.lower()) else osparameter | ||
agentos = platform.system() | ||
if (agentos.lower().startswith(osparameter.lower()[:3])): | ||
print ('Job ran on %s OS' %agentos) | ||
else: | ||
raise Exception('Job ran on the Wrong OS: %s' %agentos) |