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

Update .gitlab-ci.yml, .gitlab/ci/test.dependency_check.yml files

parent 97a77958
No related branches found
No related tags found
1 merge request!33Resolve "Integrate dependency-check container with Sonarqube"
......@@ -2,12 +2,12 @@ stages:
- verify
- build
- test
- test:npm_install
- test:dependency_checker
- test:sonar-scanner
- publish
- security
include:
- local: .gitlab/ci/test.dependency_check.yml
.Check Makefile:
stage: verify
tags:
......@@ -38,67 +38,6 @@ stages:
- docker run --rm its-registry.unl.edu/unl-its/docker-ci/static-code-analysis sonar-scanner -v
- docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/detect-secrets -s
Test Dependency Checker npm install:
stage: test:npm_install
tags:
- docker
image: node:alpine
cache:
paths:
- t/dependency-check/simple-app/node_modules/
script:
- cd t/dependency-check/simple-app/
- npm install
Test Dependency Checker sonar-scanner:
stage: test:sonar-scanner
image:
name: its-registry.unl.edu/unl-its/docker-ci/static-code-analysis
cache:
policy: pull
paths:
- t/dependency-check/simple-app/dependency_check_results/
variables:
DEPENDENCY_CHECK_OUT_DIR: t/dependency-check/simple-app/dependency_check_results/
SRC_DIR: t/dependency-check/simple-app/
tags:
- docker
script:
- sonar-scanner -Dsonar.host.url=$SONAR_URL -Dsonar.projectKey=$CI_PROJECT_PATH_SLUG -Dsonar.sources=$SRC_DIR -Dsonar.login=$SONAR_TOKEN -Dsonar.dependencyCheck.reportPath=${DEPENDENCY_CHECK_OUT_DIR}/dependency-check-report.xml -Dsonar.dependencyCheck.htmlReportPath=${DEPENDENCY_CHECK_OUT_DIR}/dependency-check-report.html -Dsonar.scm.disabled=True
Test Dependency Checker dependency_check:
stage: test:dependency_checker
image:
name: its-registry.unl.edu/unl-its/docker-ci/dependency-check
cache:
policy: pull
paths:
- t/dependency-check/simple-app/dependency_check_results/
variables:
DEPENDENCY_CHECK_OUT_DIR: t/dependency-check/simple-app/dependency_check_results/
SRC_DIR: t/dependency-check/simple-app/
tags:
- docker
script:
- dependency-check --format ALL -s ${SRC_DIR} --out ${DEPENDENCY_CHECK_OUT_DIR} --project ${CI_PROJECT_NAMESPACE} -n
artifacts:
paths:
- t/dependency-check/simple-app/dependency_check_results/dependency-check-report.html
- t/dependency-check/simple-app/dependency_check_results/dependency-check-report.xml
expire_in: 1 day
.Test Dependency Checker:
stage: test
tags:
- dockerd
script:
- ls -al
- docker run --rm -v "${PWD}/t/dependency-check/simple-app:/work" -w /work --entrypoint "/bin/ls -al" node:alpine npm install
- docker run --rm -v "${PWD}/t/dependency-check/simple-app:/work" -w /work node:alpine npm install
- docker run --rm -v "${PWD}/t/dependency-check/simple-app:/work" -w /work -e DEPENDENCY_CHECK_OUT_DIR=./ its-registry.unl.edu/unl-its/docker-ci/dependency-check
- docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/static-code-analysis sonar-scanner -Dsonar.host.url=$SONAR_URL -Dsonar.projectKey=$CI_PROJECT_PATH_SLUG -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN -Dsonar.dependencyCheck.reportPath=dependency-check-report.xml -Dsonar.dependencyCheck.htmlReportPath=dependency-check-report.html
.Test PHP Lint:
stage: test
tags:
......
test:dependency_checker:npm_install:
stage: test
tags:
- docker
image: node:alpine
cache:
paths:
- t/dependency-check/simple-app/node_modules/
script:
- cd t/dependency-check/simple-app/
- npm install
test:dependency_checker:sonar-scanner:
stage: test
needs: ["test:dependency_checker:npm_install"]
image:
name: its-registry.unl.edu/unl-its/docker-ci/static-code-analysis
cache:
policy: pull
paths:
- t/dependency-check/simple-app/dependency_check_results/
variables:
DEPENDENCY_CHECK_OUT_DIR: t/dependency-check/simple-app/dependency_check_results/
SRC_DIR: t/dependency-check/simple-app/
tags:
- docker
script:
- sonar-scanner -Dsonar.host.url=$SONAR_URL -Dsonar.projectKey=$CI_PROJECT_PATH_SLUG -Dsonar.sources=$SRC_DIR -Dsonar.login=$SONAR_TOKEN -Dsonar.dependencyCheck.reportPath=${DEPENDENCY_CHECK_OUT_DIR}/dependency-check-report.xml -Dsonar.dependencyCheck.htmlReportPath=${DEPENDENCY_CHECK_OUT_DIR}/dependency-check-report.html -Dsonar.scm.disabled=True
test:dependency_checker:dependency_check:
stage: test
needs: ["test:dependency_checker:sonar-scanner"]
image:
name: its-registry.unl.edu/unl-its/docker-ci/dependency-check
cache:
policy: pull
paths:
- t/dependency-check/simple-app/dependency_check_results/
variables:
DEPENDENCY_CHECK_OUT_DIR: t/dependency-check/simple-app/dependency_check_results/
SRC_DIR: t/dependency-check/simple-app/
tags:
- docker
script:
- dependency-check --format ALL -s ${SRC_DIR} --out ${DEPENDENCY_CHECK_OUT_DIR} --project ${CI_PROJECT_NAMESPACE} -n
artifacts:
paths:
- t/dependency-check/simple-app/dependency_check_results/dependency-check-report.html
- t/dependency-check/simple-app/dependency_check_results/dependency-check-report.xml
expire_in: 1 day
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment