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

Enable 1ES pools in JS repository #13064

Merged
merged 4 commits into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 66 additions & 39 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,58 @@
parameters:
Artifacts: []
TestPipeline: false
ServiceDirectory: not-specified
Matrix:
Linux_Node8:
OSVmImage: "ubuntu-18.04"
NodeTestVersion: "8.x"
TestType: "node"
Windows_Node10:
OSVmImage: "windows-2019"
NodeTestVersion: "10.x"
TestType: "node"
macOS_Node12:
OSVmImage: "macOS-10.15"
NodeTestVersion: "12.x"
TestType: "node"
Browser_Linux_Node12:
OSVmImage: "ubuntu-18.04"
NodeTestVersion: "$(NodeVersion)"
TestType: "browser"
Linux_Node14:
OSVmImage: "ubuntu-18.04"
NodeTestVersion: "14.x"
TestType: "node"
- name: Artifacts
type: object
default: []
- name: TestPipeline
type: boolean
default: false
- name: ServiceDirectory
type: string
default: not-specified
- name: WindowsPool
type: string
default: azsdk-pool-mms-win-2019-general
- name: LinuxPool
type: string
default: azsdk-pool-mms-ubuntu-1804-general
- name: RunUnitTests
type: boolean
default: true
- name: Matrix
type: object
default:
Linux_Node8:
Pool: $(LinuxPool)
OSVmImage:
NodeTestVersion: "8.x"
TestType: "node"
Windows_Node10:
Pool: $(WindowsPool)
OSVmImage:
NodeTestVersion: "10.x"
TestType: "node"
macOS_Node12:
Pool:
OSVmImage: "macOS-10.15"
NodeTestVersion: "12.x"
TestType: "node"
Browser_Linux_Node12:
Pool: $(LinuxPool)
OSVmImage: "ubuntu-18.04"
NodeTestVersion: "$(NodeVersion)"
TestType: "browser"
Linux_Node14:
Pool: $(LinuxPool)
OSVmImage: "ubuntu-18.04"
NodeTestVersion: "14.x"
TestType: "node"

jobs:
- job: "Build"
variables:
- template: ../variables/globals.yml

pool:
vmImage: "$(OSVmImage)"
name: ${{ parameters.LinuxPool }}

steps:
- script: |
Expand All @@ -57,7 +79,7 @@ jobs:
- template: ../variables/globals.yml

pool:
vmImage: "$(OSVmImage)"
name: ${{ parameters.LinuxPool }}

steps:
- template: ../steps/common.yml
Expand All @@ -69,21 +91,26 @@ jobs:

# Only run tests if the matrix has entries
- ${{ if ne(parameters.RunUnitTests, false) }}:
- job: "UnitTest"
- job: "UnitTest"

strategy:
matrix: ${{parameters.Matrix}}
strategy:
matrix: ${{parameters.Matrix}}

pool:
vmImage: "$(OSVmImage)"
pool:
name: $[coalesce(variables['Pool'], '')]
vmImage: $[coalesce(variables['OSVmImage'], '')]

variables:
- template: ../variables/globals.yml
variables:
- template: ../variables/globals.yml
- name: WindowsPool
value: ${{ parameters.WindowsPool }}
- name: LinuxPool
value: ${{ parameters.LinuxPool }}

steps:
- template: ../steps/common.yml
steps:
- template: ../steps/common.yml

- template: ../steps/test.yml
parameters:
Artifacts: ${{parameters.Artifacts}}
ServiceDirectory: ${{parameters.ServiceDirectory}}
- template: ../steps/test.yml
parameters:
Artifacts: ${{parameters.Artifacts}}
ServiceDirectory: ${{parameters.ServiceDirectory}}
88 changes: 48 additions & 40 deletions eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,52 @@
parameters:
- name: Artifacts
type: object
default: []
- name: TestPipeline
type: boolean
default: false
- name: ServiceDirectory
type: string
default: not-specified
- name: IncludeRelease
type: boolean
default: true
- name: TargetDocRepoOwner
type: string
default: MicrosoftDocs
- name: TargetDocRepoName
type: string
default: azure-docs-sdk-node
- name: RunUnitTests
type: boolean
default: true
- name: Artifacts
type: object
default: []
- name: TestPipeline
type: boolean
default: false
- name: ServiceDirectory
type: string
default: not-specified
- name: IncludeRelease
type: boolean
default: true
- name: TargetDocRepoOwner
type: string
default: MicrosoftDocs
- name: TargetDocRepoName
type: string
default: azure-docs-sdk-node
- name: RunUnitTests
type: boolean
default: true
- name: WindowsPool
type: string
default: azsdk-pool-mms-win-2019-general
- name: LinuxPool
type: string
default: azsdk-pool-mms-ubuntu-1804-general

stages:
- stage: Build
jobs:
- template: ../jobs/archetype-sdk-client.yml
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
Artifacts: ${{ parameters.Artifacts }}
TestPipeline: ${{ parameters.TestPipeline }}
RunUnitTests: ${{ parameters.RunUnitTests }}
- stage: Build
jobs:
- template: ../jobs/archetype-sdk-client.yml
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
Artifacts: ${{ parameters.Artifacts }}
TestPipeline: ${{ parameters.TestPipeline }}
RunUnitTests: ${{ parameters.RunUnitTests }}
WindowsPool: ${{ parameters.WindowsPool }}
LinuxPool: ${{ parameters.LinuxPool }}

# The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch.
- ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'), eq(parameters.IncludeRelease,true))}}:
- template: archetype-js-release.yml
parameters:
DependsOn: Build
ServiceDirectory: ${{ parameters.ServiceDirectory }}
Artifacts: ${{ parameters.Artifacts }}
TestPipeline: ${{ parameters.TestPipeline }}
ArtifactName: packages
TargetDocRepoOwner: ${{ parameters.TargetDocRepoOwner }}
TargetDocRepoName: ${{ parameters.TargetDocRepoName }}
# The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch.
- ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'), eq(parameters.IncludeRelease,true))}}:
- template: archetype-js-release.yml
parameters:
DependsOn: Build
ServiceDirectory: ${{ parameters.ServiceDirectory }}
Artifacts: ${{ parameters.Artifacts }}
TestPipeline: ${{ parameters.TestPipeline }}
ArtifactName: packages
TargetDocRepoOwner: ${{ parameters.TargetDocRepoOwner }}
TargetDocRepoName: ${{ parameters.TargetDocRepoName }}
2 changes: 0 additions & 2 deletions eng/pipelines/templates/steps/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ steps:
inputs:
versionSpec: "3.6"

- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml
mitchdenny marked this conversation as resolved.
Show resolved Hide resolved

- template: use-node-version.yml