Skip to content
Snippets Groups Projects
Commit 055ed1d6 authored by Raul Barreras's avatar Raul Barreras
Browse files

Update examples/dependency-check.md

parent e2e95ca0
No related branches found
No related tags found
1 merge request!33Resolve "Integrate dependency-check container with Sonarqube"
...@@ -12,24 +12,33 @@ ...@@ -12,24 +12,33 @@
- One 'analysis' stage with one job - One 'analysis' stage with one job
- Allows the job to fail without impacting the rest of the CI (allow_failure: true) - Allows the job to fail without impacting the rest of the CI (allow_failure: true)
- Export the results as an artifact
``` yml ``` yml
stages: stages:
- analysis - analysis
variables: dependency_check:
stage: analysis stage: analysis
image:
name: its-registry.unl.edu/unl-its/docker-ci/dependency-check
variables:
DEPENDENCY_CHECK_OUT_DIR: ./dependency_check_results/
tags: tags:
- docker - docker
script: script:
- docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/detect-secrets -s -e 4.5 - dependency-check --format ALL -s ./ --out ${DEPENDENCY_CHECK_OUT_DIR} --project ${CI_PROJECT_NAMESPACE}
- docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/dependency-check artifacts:
paths:
- ./dependency_check_results/dependency-check-report.html
- ./dependency_check_results/dependency_check_results/dependency-check-report.xml
expire_in: 1 day
allow_failure: true allow_failure: true
``` ```
## Scan the current directory (must be a git repo) ## Scan the current directory (must be a git repo)
``` bash ``` bash
docker run -it --rm -v "${PWD}:/work" -w /work -e CI_PROJECT_NAMESPACE=`basename $(git rev-parse --show-toplevel)` its-registry.unl.edu/unl-its/docker-ci/dependency-check CI_PROJECT_NAMESPACE=`basename $(git rev-parse --show-toplevel)`
docker run -it --rm -v "${PWD}:/work" -w /work -e CI_PROJECT_NAMESPACE=${CI_PROJECT_NAMESPACE} its-registry.unl.edu/unl-its/docker-ci/dependency-check dependency-check --format ALL -s ./ --out ./dependency_check_results --project ${CI_PROJECT_NAMESPACE}
``` ```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment