Describe the bug
When using the Kubernetes Plugin, which runs builds on pods in a kubernetes cluster, as the pod is dead the workspace that is on the pod will also be gone.
When we use the
dependencyCheckPublisher
on the pipeline, it does not detect that it is running on a worker node and wont transfer the file back to the master before publishing it.
This will cause the pipeline step to report
[DependencyCheck] Unable to find Dependency-Check reports to parse
ls -lah
total 220K
drwxr-xr-x 9 owasp owasp 4.0K Dec 18 01:31 .
drwxr-xr-x 4 owasp owasp 4.0K Dec 18 01:28 ..
-rw-r--r-- 1 owasp owasp 204 Dec 18 01:28 .dockerignore
drwxr-xr-x 8 owasp owasp 4.0K Dec 18 01:28 .git
-rw-r--r-- 1 owasp owasp 94 Dec 18 01:28 .gitignore
drwxr-xr-x 5 owasp owasp 4.0K Dec 18 01:29 .gradle
drwxr-xr-x 9 owasp owasp 4.0K Dec 18 01:30 build
-rw-r--r-- 1 owasp owasp 1.1K Dec 18 01:28 build.gradle
-rw-r--r-- 1 owasp owasp 126.1K Dec 18 01:31 dependency-check-report.html
drwxr-xr-x 2 owasp owasp 4.0K Dec 18 01:28 docker
drwxr-xr-x 2 owasp owasp 4.0K Dec 18 01:28 dockergradle
drwxr-xr-x 3 owasp owasp 4.0K Dec 18 01:28 gradle
-rw-r--r-- 1 owasp owasp 722 Dec 18 01:28 gradle-cache.jenkinsfile
-rw-r--r-- 1 owasp owasp 112 Dec 18 01:28 gradle.properties
-rwxr-xr-x 1 owasp owasp 5.8K Dec 18 01:28 gradlew
-rw-r--r-- 1 owasp owasp 2.9K Dec 18 01:28 gradlew.bat
-rw-r--r-- 1 owasp owasp 2.3K Dec 18 01:28 integration-test.gradle
-rw-r--r-- 1 owasp owasp 2.1K Dec 18 01:28 jobs.gradle
-rw-r--r-- 1 owasp owasp 790 Dec 18 01:28 merged.jenkinsfile
-rw-r--r-- 1 owasp owasp 32 Dec 18 01:28 settings.gradle
drwxr-xr-x 5 owasp owasp 4.0K Dec 18 01:28 src
-rw-r--r-- 1 owasp owasp 731 Dec 18 01:28 tint.jenkinsfile
-rw-r--r-- 1 owasp owasp 333 Dec 18 01:28 verify.jenkinsfile
[Pipeline] dependencyCheckPublisher
[DependencyCheck] Collecting Dependency-Check artifact
[DependencyCheck] Unable to find Dependency-Check reports to parse
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The publish step should be able to find the report file on the ephermeral node , instead of trying to find it in the workspace in the master jenkins.
Additional context
If we use the HTML Publish plugin
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: './results', reportFiles: 'dependency-check-report.html', reportName: 'OWASP Report', reportTitles: ''])
it will detect that the report is on a ephemeral node and will move the report to the jenkins master reporting something like this
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /home/jenkins/agent/workspace/slaveworkspace/results to /var/jenkins_home/jobs/masterworkspace/htmlreports/OWASP_20Report
Describe the bug When using the Kubernetes Plugin, which runs builds on pods in a kubernetes cluster, as the pod is dead the workspace that is on the pod will also be gone.
When we use the
on the pipeline, it does not detect that it is running on a worker node and wont transfer the file back to the master before publishing it.
This will cause the pipeline step to report
Example of the Pipelinescript:
Version of dependency-check used 5.2.4
Log file
drwxr-xr-x 9 owasp owasp 4.0K Dec 18 01:31 . drwxr-xr-x 4 owasp owasp 4.0K Dec 18 01:28 .. -rw-r--r-- 1 owasp owasp 204 Dec 18 01:28 .dockerignore drwxr-xr-x 8 owasp owasp 4.0K Dec 18 01:28 .git -rw-r--r-- 1 owasp owasp 94 Dec 18 01:28 .gitignore drwxr-xr-x 5 owasp owasp 4.0K Dec 18 01:29 .gradle drwxr-xr-x 9 owasp owasp 4.0K Dec 18 01:30 build -rw-r--r-- 1 owasp owasp 1.1K Dec 18 01:28 build.gradle -rw-r--r-- 1 owasp owasp 126.1K Dec 18 01:31 dependency-check-report.html drwxr-xr-x 2 owasp owasp 4.0K Dec 18 01:28 docker drwxr-xr-x 2 owasp owasp 4.0K Dec 18 01:28 dockergradle drwxr-xr-x 3 owasp owasp 4.0K Dec 18 01:28 gradle -rw-r--r-- 1 owasp owasp 722 Dec 18 01:28 gradle-cache.jenkinsfile -rw-r--r-- 1 owasp owasp 112 Dec 18 01:28 gradle.properties -rwxr-xr-x 1 owasp owasp 5.8K Dec 18 01:28 gradlew -rw-r--r-- 1 owasp owasp 2.9K Dec 18 01:28 gradlew.bat -rw-r--r-- 1 owasp owasp 2.3K Dec 18 01:28 integration-test.gradle -rw-r--r-- 1 owasp owasp 2.1K Dec 18 01:28 jobs.gradle -rw-r--r-- 1 owasp owasp 790 Dec 18 01:28 merged.jenkinsfile -rw-r--r-- 1 owasp owasp 32 Dec 18 01:28 settings.gradle drwxr-xr-x 5 owasp owasp 4.0K Dec 18 01:28 src -rw-r--r-- 1 owasp owasp 731 Dec 18 01:28 tint.jenkinsfile -rw-r--r-- 1 owasp owasp 333 Dec 18 01:28 verify.jenkinsfile [Pipeline] dependencyCheckPublisher [DependencyCheck] Collecting Dependency-Check artifact [DependencyCheck] Unable to find Dependency-Check reports to parse
To Reproduce Steps to reproduce the behavior:
Expected behavior The publish step should be able to find the report file on the ephermeral node , instead of trying to find it in the workspace in the master jenkins.
Additional context If we use the HTML Publish plugin
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: './results', reportFiles: 'dependency-check-report.html', reportName: 'OWASP Report', reportTitles: ''])
it will detect that the report is on a ephemeral node and will move the report to the jenkins master reporting something like this