Skip to content

Commit

Permalink
Remove OSName variable since its is being set in the verifyagentOS Sc…
Browse files Browse the repository at this point in the history
…ript (#11100)
  • Loading branch information
chidozieononiwu authored May 13, 2020
1 parent 66ee8c3 commit 936685d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 48 deletions.
38 changes: 38 additions & 0 deletions eng/common/pipelines/templates/steps/verify-agent-os.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Template for all Python Scripts in this repository
parameters:
OSVmImage: $(OSVmImage)

steps:
- task: PythonScript@0
displayName: Verify Agent OS
inputs:
scriptSource: inline
script: |
# 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 friendly name or image name of the os to verfy against
from __future__ import print_function
import sys
import platform
os_parameter = "${{ parameters.OSVmImage }}".lower()
if os_parameter.startswith('mac') or os_parameter.startswith('darwin'):
os_parameter = 'macOS'
elif os_parameter.startswith('ubuntu') or os_parameter.startswith('linux'):
os_parameter = 'Linux'
elif os_parameter.startswith('vs') or os_parameter.startswith('win'):
os_parameter = 'Windows'
else:
raise Exception('Variable OSVmImage is empty or has an unexpected value')
print("Job requested to run on OS: %s" % (os_parameter))
agent_os = platform.system()
agent_os = 'macOS' if agent_os == 'Darwin' else agent_os
if (agent_os.lower() == os_parameter.lower()):
print('Job ran on OS: %s' % (agent_os))
print('##vso[task.setvariable variable=OSName]%s' % (agent_os))
else:
raise Exception('Job ran on the wrong OS: %s' % (agent_os))
10 changes: 1 addition & 9 deletions eng/pipelines/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,37 +164,29 @@ jobs:
strategy:
matrix:
Linux - Java 8:
OSName: 'Linux'
OSVmImage: 'ubuntu-18.04'
JavaVersion: '1.8'
macOS - Java 8:
OSName: 'macOS'
OSVmImage: 'macOS-10.15'
JavaVersion: '1.8'
Windows - Java 8:
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.8'
Linux - Java 11:
OSName: 'Linux'
OSVmImage: 'ubuntu-18.04'
JavaVersion: '1.11'
macOS - Java 11:
OSName: 'macOS'
OSVmImage: 'macOS-10.15'
JavaVersion: '1.11'
Windows - Java 11:
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.11'

pool:
vmImage: $(OSVmImage)

steps:
- template: eng/pipelines/templates/scripts/verify-agent-os.yml@azure-sdk-tools
parameters:
OSName: $(OSVmImage)
- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml

- task: Maven@3
displayName: 'Compile all code and run tests'
Expand Down
11 changes: 1 addition & 10 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,30 @@ parameters:
TestGoals: verify
TestMatrix:
Linux - Java 8:
OSName: 'Linux'
OSVmImage: 'ubuntu-18.04'
JavaVersion: '1.8'
RunTitle: 'Linux on Java 1.8'
macOS - Java 8:
OSName: 'macOS'
OSVmImage: 'macOS-10.15'
JavaVersion: '1.8'
RunTitle: 'macOS on Java 1.8'
Windows - Java 8:
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.8'
RunTitle: 'Windows on Java 1.8'
Linux - Java 11:
OSName: 'Linux'
OSVmImage: 'ubuntu-18.04'
JavaVersion: '1.11'
RunTitle: 'Linux on Java 1.11'
macOS - Java 11:
OSName: 'macOS'
OSVmImage: 'macOS-10.15'
JavaVersion: '1.11'
RunTitle: 'macOS on Java 1.11'
Windows - Java 11:
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.11'
RunTitle: 'Windows on Java 1.11'
Windows From Source - Java 8:
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.8'
RunTitle: 'From Source: Windows on Java 1.8'
Expand Down Expand Up @@ -213,9 +206,7 @@ jobs:
vmImage: $(OSVmImage)

steps:
- template: ../steps/verify-agent-os.yml
parameters:
OSName: $(OSName)
- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml

- template: ../steps/cache-maven-repository.yml

Expand Down
10 changes: 1 addition & 9 deletions eng/pipelines/templates/jobs/archetype-sdk-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,26 @@ parameters:
TestGoals: verify
TestMatrix:
Linux - Java 8:
OSName: 'Linux'
OSVmImage: 'ubuntu-18.04'
JavaVersion: '1.8'
RunTitle: 'Linux on Java 1.8'
macOS - Java 8:
OSName: 'macOS'
OSVmImage: 'macOS-10.15'
JavaVersion: '1.8'
RunTitle: 'macOS on Java 1.8'
Windows - Java 8:
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.8'
RunTitle: 'Windows on Java 1.8'
Linux - Java 11:
OSName: 'Linux'
OSVmImage: 'ubuntu-18.04'
JavaVersion: '1.11'
RunTitle: 'Linux on Java 1.11'
macOS - Java 11:
OSName: 'macOS'
OSVmImage: 'macOS-10.15'
JavaVersion: '1.11'
RunTitle: 'macOS on Java 1.11'
Windows - Java 11:
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.11'
RunTitle: 'Windows on Java 1.11'
Expand Down Expand Up @@ -185,9 +179,7 @@ jobs:
vmImage: $(OSVmImage)

steps:
- template: ../steps/verify-agent-os.yml
parameters:
OSName: $(OSName)
- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml

- template: ../steps/cache-maven-repository.yml

Expand Down
8 changes: 2 additions & 6 deletions eng/pipelines/templates/jobs/archetype-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,36 @@ parameters:
MaxParallel: 0
Matrix:
Linux - Java 8 (AzureCloud):
OSName: 'Linux'
OSVmImage: 'ubuntu-18.04'
JavaVersion: '1.8'
DisplayName: 'Linux - Java 8'
CloudType: AzureCloud
AZURE_TEST_HTTP_CLIENTS: netty
macOS - Java 8 (AzureCloud):
OSName: 'macOS'
OSVmImage: 'macOS-10.15'
JavaVersion: '1.8'
DisplayName: 'macOS - Java 8'
CloudType: AzureCloud
AZURE_TEST_HTTP_CLIENTS: okhttp
Windows - Java 8 (AzureCloud):
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.8'
DisplayName: 'Windows - Java 8'
CloudType: AzureCloud
AZURE_TEST_HTTP_CLIENTS: netty
Linux - Java 11 (AzureCloud):
OSName: 'Linux'
OSVmImage: 'ubuntu-18.04'
JavaVersion: '1.11'
DisplayName: 'Linux - Java 11'
CloudType: AzureCloud
AZURE_TEST_HTTP_CLIENTS: okhttp
macOS - Java 11 (AzureCloud):
OSName: 'macOS'
OSVmImage: 'macOS-10.15'
JavaVersion: '1.11'
DisplayName: 'macOS - Java 11'
CloudType: AzureCloud
AZURE_TEST_HTTP_CLIENTS: netty
Windows - Java 11 (AzureCloud):
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.11'
DisplayName: 'Windows - Java 11'
Expand Down Expand Up @@ -75,6 +69,8 @@ jobs:
vmImage: $(OSVmImage)

steps:
- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml

- template: /eng/common/pipelines/templates/steps/bypass-local-dns.yml

- ${{ if ne(parameters.DisableAzureResourceCreation, 'true') }}:
Expand Down
7 changes: 0 additions & 7 deletions eng/pipelines/templates/stages/cosmos-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,36 @@ stages:
SDKType: ${{parameters.SDKType}}
TestMatrix:
Linux - Java 8:
OSName: 'Linux'
OSVmImage: 'ubuntu-18.04'
JavaVersion: '1.8'
RunTitle: 'Linux on Java 1.8'
ProfileFlag: '-Punit'
macOS - Java 8:
OSName: 'macOS'
OSVmImage: 'macOS-10.15'
JavaVersion: '1.8'
RunTitle: 'macOS on Java 1.8'
ProfileFlag: '-Punit'
Windows - Java 8:
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.8'
RunTitle: 'Windows on Java 1.8'
ProfileFlag: '-Punit'
Linux - Java 11:
OSName: 'Linux'
OSVmImage: 'ubuntu-18.04'
JavaVersion: '1.11'
RunTitle: 'Linux on Java 1.11'
ProfileFlag: '-Punit'
macOS - Java 11:
OSName: 'macOS'
OSVmImage: 'macOS-10.15'
JavaVersion: '1.11'
RunTitle: 'macOS on Java 1.11'
ProfileFlag: '-Punit'
Windows - Java 11:
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.11'
RunTitle: 'Windows on Java 1.11'
ProfileFlag: '-Punit'
Windows From Source - Java 8:
OSName: 'Windows'
OSVmImage: 'windows-2019'
JavaVersion: '1.8'
RunTitle: 'From Source: Windows on Java 1.8'
Expand Down
7 changes: 0 additions & 7 deletions eng/pipelines/templates/steps/verify-agent-os.yml

This file was deleted.

0 comments on commit 936685d

Please sign in to comment.