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

[FAB-13051] npm audit checks #20

Merged
merged 1 commit into from
Nov 7, 2019
Merged
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
23 changes: 23 additions & 0 deletions ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,29 @@ stages:
inputs:
pathToPublish: tools/toolchain/network/docker-compose/logs/docker.log
artifactName: nodeenv-docker-image

# Job to handle the auditing of the code
# NPM audit is run on a 'fake' installation of the libraries
# Pulling in all the dependencies it will be able to run NPM AUDIT, and if that returns a
# error code the job will fail.
- job: src_audit
displayName: 'Node Module Auditing'
dependsOn: main
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
- task: DownloadPipelineArtifact@2
inputs:
artifact: node-tgz
path: $(Build.SourcesDirectory)/build
- script: |
node common/scripts/install-run-rush.js install
node common/scripts/install-run-rush.js start-verdaccio # script will check for the ci variable and use built images
mkdir -p $(Build.SourcesDiredctory)/audit && cd $(Build.SourcesDiredctory)/audit && npm init -y
npm install --registry http://localhost:4873 fabric-shim fabric-shim-crypto fabric-shim-api fabric-contract-api --save
npm audit

# Publish tag for the Merge build of a regular PRi.e. w
- stage: Publish_tag
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
Expand Down