This repository was archived by the owner on May 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 560
Azure Pipeline for KeyVault #4226
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e1125d6
Pipeline to build and test KeyVault
mikeharder 9c633be
Rename variable "path" to "build.path"
mikeharder ba9f3f1
Fix sourceFolder in "Copy Package" step
mikeharder 16c39b6
Rename variable "path" to "build.path"
mikeharder 9fa5493
Test ComponentGovernance task
mikeharder 537852e
Move audit steps into separate job
mikeharder 56373d3
Run "npm audit" in $(build.path)
mikeharder 77b2edd
Run component governance even if "npm audit" fails
mikeharder e646bdc
Run "npm i --package-lock-only" before "npm audit"
mikeharder 3bef302
Fix powershell working directory parameter
mikeharder b5756db
Fix powershell working directory
mikeharder 52706fd
Add Node 6.x
mikeharder 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 |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| parameters: | ||
| name: '' | ||
| vmImage: '' | ||
|
|
||
| jobs: | ||
| - job: ${{ format('Test_{0}', parameters.name) }} | ||
| dependsOn: | ||
| - 'Publish' | ||
|
|
||
| pool: | ||
| vmImage: ${{ parameters.vmImage }} | ||
|
|
||
| variables: | ||
| build.path: 'test/services/keyVault' | ||
|
|
||
| strategy: | ||
| matrix: | ||
| Node6: | ||
| node.version: '6.x' | ||
| Node8: | ||
| node.version: '8.x' | ||
| Node10: | ||
| node.version: '10.x' | ||
| Node11: | ||
| node.version: '11.x' | ||
|
|
||
| steps: | ||
| - task: NodeTool@0 | ||
| inputs: | ||
| versionSpec: '$(node.version)' | ||
| displayName: 'Install Node.js $(node.version)' | ||
|
|
||
| - task: Npm@1 | ||
| inputs: | ||
| command: 'install' | ||
| displayName: 'npm install' | ||
|
|
||
| - task: Npm@1 | ||
| inputs: | ||
| command: 'custom' | ||
| customCommand: 'run mocha -- $(build.path) --reporter mocha-junit-reporter' | ||
| displayName: 'npm run mocha' | ||
|
|
||
| - task: PublishTestResults@2 | ||
| inputs: | ||
| testResultsFiles: '**/test-results.xml' | ||
| testRunTitle: ${{ format('{0} Node $(node.version)', parameters.name) }} | ||
| condition: succeededOrFailed() | ||
| displayName: 'Publish test results' | ||
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 |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| trigger: | ||
| - master | ||
|
|
||
| variables: | ||
| node.version: '10.x' | ||
| build.path: 'lib/services/keyVault' | ||
|
|
||
| jobs: | ||
| - job: 'Publish' | ||
|
|
||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
|
|
||
| steps: | ||
| - task: NodeTool@0 | ||
| inputs: | ||
| versionSpec: '$(node.version)' | ||
| displayName: 'Install Node.js $(node.version)' | ||
|
|
||
| - task: Npm@1 | ||
| inputs: | ||
| command: 'install' | ||
| workingDir: '$(build.path)' | ||
| displayName: 'npm install' | ||
|
|
||
| - task: Npm@1 | ||
| inputs: | ||
| command: 'custom' | ||
| customCommand: 'pack' | ||
| workingDir: '$(build.path)' | ||
| displayName: 'npm pack' | ||
|
|
||
| - task: CopyFiles@2 | ||
| inputs: | ||
| sourceFolder: '$(build.path)' | ||
| contents: '*.tgz' | ||
| targetFolder: $(Build.ArtifactStagingDirectory) | ||
| displayName: 'Copy Package' | ||
|
|
||
| - task: PublishBuildArtifacts@1 | ||
| displayName: 'Publish Package' | ||
|
|
||
| - job: 'Audit' | ||
|
|
||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
|
|
||
| steps: | ||
| - task: NodeTool@0 | ||
| inputs: | ||
| versionSpec: '$(node.version)' | ||
| displayName: 'Install Node.js $(node.version)' | ||
|
|
||
| - task: Npm@1 | ||
| inputs: | ||
| command: 'custom' | ||
| customCommand: 'i --package-lock-only' | ||
| workingDir: '$(build.path)' | ||
| displayName: 'npm i --package-lock-only' | ||
|
|
||
| - powershell: "npm audit --json | ConvertFrom-Json | Select-Object -expandProperty 'metadata' | select-object -expandproperty 'vulnerabilities' | %{ if ($_.low + $_.moderate + $_.high + $_.critical -ne 0) { write-error 'FAILED! Your package has vulnerabilities. Check npm audit' }}" | ||
mikeharder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| workingDirectory: '$(build.path)' | ||
| displayName: 'npm audit' | ||
|
|
||
| - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 | ||
| condition: succeededOrFailed() | ||
| displayName: 'Component Detection' | ||
|
|
||
| - template: client.test.yml | ||
| parameters: | ||
| name: Linux | ||
| vmImage: 'ubuntu-16.04' | ||
|
|
||
| - template: client.test.yml | ||
| parameters: | ||
| name: macOS | ||
| vmImage: 'macOS-10.13' | ||
|
|
||
| - template: client.test.yml | ||
| parameters: | ||
| name: Windows | ||
| vmImage: 'vs2017-win2016' | ||
|
|
||
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
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 |
|---|---|---|
|
|
@@ -139,6 +139,7 @@ | |
| "json-stable-stringify": "^1.0.1", | ||
| "minami": "devigned/minami#master", | ||
| "mocha": "^5.2.0", | ||
| "mocha-junit-reporter": "^1.18.0", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required for pipeline to publish test results |
||
| "nock": "0.16", | ||
| "node-forge": "0.6.30", | ||
| "nyc": "^11.2.1", | ||
|
|
@@ -168,6 +169,7 @@ | |
| "ci": "node scripts/unit.js testlist.txt", | ||
| "runtime-install": "node scripts/runtime-install.js", | ||
| "coverage": "node scripts/unit-coverage.js testlistarm.txt testlist.txt", | ||
| "debug": "node --inspect scripts/unit-arm.js testlistarm.txt" | ||
| "debug": "node --inspect scripts/unit-arm.js testlistarm.txt", | ||
| "mocha": "mocha" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this script so the pipeline can call "npm run mocha" with options to run a subset of tests. |
||
| } | ||
| } | ||
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.