dependency-check / dependency-check/azuredevops

Add cache method in documentation

Open
#110 5 comments 7 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
53
Forks
35
PR merge metrics
No merged PRs in 30d

Description

Hello

I think that most people want to reduce the runtime of their pipelines.

Because of that, I recently needed to search for a way to cache dependency-check CVE data (because it was most of the time of the dependency-check analysis, even for large repositories with many dependencies.)

I think that we need to add an "official" method on how to cache dependency-check data. For example, in my case, my dependency-check analysis passed from 2m19s of execution to 13s ... Which can be greatly appreciated for most users !

## My solution

Here is the solution I found (I don't necessarily say that is the best way, just my way, can take advices here :)) :

```yaml
- task: Bash@3
displayName: 'Look for dependency-check data directory'
inputs:
targetType: 'inline'
script: |
# Find for dependency-check root directory
dc_directory=$(find $AGENT_WORKFOLDER/_tasks -type d -name dependency-check)
echo "##vso[task.setvariable variable=DEPENDENCY_CHECK_DATA]${dc_directory}/data"

- task: Cache@2
displayName: Cache dependency check data
inputs:
key: 'dependency-check | "$(Agent.OS)"'
path: $(DEPENDENCY_CHECK_DATA)

- task: dependency-check-build-task@6
displayName: Run dependency-check analysis
inputs:
projectName: $(System.TeamProject)_$(Build.Repository.Name)
scanPath: '.tox/**/py*'
format: 'ALL'
reportsDirectory: 'dependency-check'
warnOnCVSSViolation: true
enableExperimental: true
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.