-
Notifications
You must be signed in to change notification settings - Fork 117
1ES Pipelines Template Adoption #367
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
Merged
DmitriiBobreshev
merged 3 commits into
master
from
user/v-bobreshevd/1es-template-adoption
Feb 12, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,117 +1,128 @@ | ||
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. | ||
# Please make sure to check all the converted content, it is your team's responsibility to make sure that the pipeline is still valid and functions as expected. | ||
# This pipeline will be extended to the OneESPT template | ||
# If you are not using the E+D shared hosted pool with windows-2022, replace the pool section with your hosted pool, os, and image name. If you are using a Linux image, you must specify an additional windows image for SDL: https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/sdlanalysis/overview#how-to-specify-a-windows-pool-for-the-sdl-source-analysis-stage | ||
# The Task 'PublishPipelineArtifact@1' has been converted to an output named 'Publish _build artifact' in the templateContext section. | ||
trigger: | ||
- master | ||
- releases/* | ||
|
||
- master | ||
- releases/* | ||
variables: | ||
isMaster: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')] | ||
isRelease: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/releases')] | ||
|
||
parameters: | ||
- name: nodeVersionList | ||
type: object | ||
default: [6, 8, 10, 12, 14, 16] | ||
|
||
- name: imageList | ||
type: object | ||
default: ['windows-latest', 'ubuntu-latest'] | ||
|
||
- name: publishToNpm | ||
displayName: Publish to npm | ||
type: boolean | ||
default: false | ||
|
||
stages: | ||
- stage: Build | ||
displayName: Build typed-rest-client | ||
jobs: | ||
- name: nodeVersionList | ||
type: object | ||
default: [6, 8, 10, 12, 14, 16] | ||
- name: imageList | ||
type: object | ||
default: | ||
windows: 'windows-latest' | ||
ubuntu: 'ubuntu-latest' | ||
- name: publishToNpm | ||
displayName: Publish to npm | ||
type: boolean | ||
default: false | ||
resources: | ||
repositories: | ||
- repository: 1ESPipelineTemplates | ||
type: git | ||
name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
ref: refs/tags/release | ||
extends: | ||
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates | ||
parameters: | ||
sdl: | ||
sourceAnalysisPool: | ||
name: Azure-Pipelines-1ESPT-ExDShared | ||
image: windows-2022 | ||
os: windows | ||
customBuildTags: | ||
- ES365AIMigrationTooling | ||
stages: | ||
- stage: Build | ||
displayName: Build typed-rest-client | ||
jobs: | ||
- job: Build_and_Publish | ||
displayName: Build and Publish artifact | ||
pool: | ||
vmImage: 'ubuntu-20.04' | ||
name: Azure-Pipelines-1ESPT-ExDShared | ||
image: ubuntu-latest | ||
os: linux | ||
templateContext: | ||
outputs: | ||
- output: pipelineArtifact | ||
displayName: 'Publish _build artifact' | ||
targetPath: _build | ||
artifactType: pipeline | ||
artifactName: _build | ||
steps: | ||
#build on node 8.x | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '8.x' | ||
displayName: Install node 8 | ||
|
||
- script: npm install | ||
displayName: npm install | ||
|
||
- script: npm run build | ||
displayName: npm run build | ||
|
||
- task: PublishPipelineArtifact@1 | ||
displayName: Publish _build artifact | ||
inputs: | ||
targetPath: _build | ||
artifactType: pipeline | ||
artifactName: _build | ||
|
||
# run unit tests on different platforms and node versions | ||
- stage: Test | ||
displayName: Test typed-rest-client | ||
jobs: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '8.x' | ||
displayName: Install node 8 | ||
- script: npm install | ||
displayName: npm install | ||
- script: npm run build | ||
displayName: npm run build | ||
- stage: Test | ||
displayName: Test typed-rest-client | ||
jobs: | ||
- ${{ each image in parameters.imageList }}: | ||
- ${{ each nodeVersion in parameters.nodeVersionList }}: | ||
- job: Node_os_${{ nodeVersion }}_${{ replace(image,'-','_') }} | ||
displayName: Node.js ${{ nodeVersion }} on ${{ image }} | ||
pool: | ||
vmImage: ${{ image }} | ||
steps: | ||
- task: DownloadPipelineArtifact@2 | ||
displayName: Download built typed-rest-client package | ||
inputs: | ||
artifact: _build | ||
path: $(Build.SourcesDirectory)/_build | ||
patterns: '!package-lock.json' #Exclude package-lock.json | ||
|
||
- script: npm install | ||
displayName: npm install | ||
|
||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: ${{ nodeVersion }}.x | ||
displayName: Install node ${{ nodeVersion }} | ||
|
||
- script: npm run units | ||
displayName: npm run units | ||
|
||
- script: npm run test | ||
displayName: npm run test | ||
|
||
- stage: Publish | ||
condition: and(succeeded(), or(eq('${{ parameters.publishToNpm }}', true), eq(variables.isRelease, true), eq(variables.isMaster, true))) | ||
jobs: | ||
- ${{ each nodeVersion in parameters.nodeVersionList }}: | ||
- job: Node_os_${{ nodeVersion }}_${{ image.key }} | ||
displayName: Node.js ${{ nodeVersion }} on ${{ image.key }} | ||
pool: | ||
name: Azure-Pipelines-1ESPT-ExDShared | ||
image: ${{ image.value }} | ||
os: ${{ image.key }} | ||
steps: | ||
- task: DownloadPipelineArtifact@2 | ||
displayName: Download built typed-rest-client package | ||
inputs: | ||
artifact: _build | ||
path: $(Build.SourcesDirectory)/_build | ||
patterns: '!package-lock.json' | ||
- script: npm install | ||
displayName: npm install | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: ${{ nodeVersion }}.x | ||
displayName: Install node ${{ nodeVersion }} | ||
- script: npm run units | ||
displayName: npm run units | ||
- script: npm run test | ||
displayName: npm run test | ||
- stage: Publish | ||
condition: and(succeeded(), or(eq('${{ parameters.publishToNpm }}', true), eq(variables.isRelease, true), eq(variables.isMaster, true))) | ||
jobs: | ||
- job: Publish_package | ||
displayName: Publish npm package | ||
pool: | ||
vmImage: 'ubuntu-20.04' | ||
name: Azure-Pipelines-1ESPT-ExDShared | ||
image: ubuntu-latest | ||
os: linux | ||
steps: | ||
- task: DownloadPipelineArtifact@2 | ||
displayName: Download built typed-rest-client package | ||
inputs: | ||
artifact: _build | ||
path: $(Build.SourcesDirectory)/_build | ||
|
||
- task: Npm@1 | ||
displayName: Publish typed-rest-client to npm | ||
inputs: | ||
command: publish | ||
workingDir: '_build' | ||
publishRegistry: useExternalRegistry | ||
publishEndpoint: NPM-Automation-Token | ||
continueOnError: true | ||
|
||
- script: npm install | ||
displayName: npm install | ||
continueOnError: true | ||
condition: and(succeeded(), eq(variables.isMaster, true)) | ||
|
||
- script: node ./ci/create-release-notes.js | ||
continueOnError: true | ||
condition: and(succeeded(), eq(variables.isMaster, true)) | ||
env: | ||
GH_TOKEN: $(githubToken) | ||
branch: $(Build.SourceBranchName) | ||
displayName: Create Release | ||
- task: DownloadPipelineArtifact@2 | ||
displayName: Download built typed-rest-client package | ||
inputs: | ||
artifact: _build | ||
path: $(Build.SourcesDirectory)/_build | ||
- task: Npm@1 | ||
displayName: Publish typed-rest-client to npm | ||
inputs: | ||
command: publish | ||
workingDir: '_build' | ||
publishRegistry: useExternalRegistry | ||
publishEndpoint: NPM-Automation-Token | ||
continueOnError: true | ||
- script: npm install | ||
displayName: npm install | ||
continueOnError: true | ||
condition: and(succeeded(), eq(variables.isMaster, true)) | ||
- script: node ./ci/create-release-notes.js | ||
continueOnError: true | ||
condition: and(succeeded(), eq(variables.isMaster, true)) | ||
env: | ||
GH_TOKEN: $(githubToken) | ||
branch: $(Build.SourceBranchName) | ||
displayName: Create Release |
localconst marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.