Fixed .workflow/jenkinsfile
Some checks failed
CICD-UCN/Agent86/pipeline/head There was a failure building this commit

This commit is contained in:
Karsten Jeppesen
2026-09-01 11:54:05 +02:00
parent b30ef618bd
commit 41c5718969

View File

@@ -86,7 +86,7 @@ pipeline {
} }
stage('Scan with Ollama') { stage('Scan with Ollama') {
when { expression { fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } } when { branch 'Security' && expression { fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
steps { steps {
sh ".workflow/scan_with_ollama.sh \"$TEXT_FILES_FILE\" \"$SCAN_JSON_FILE\" \"$OLLAMA_MODEL\" \"$MAX_FILE_BYTES\" \"$REQUEST_TIMEOUT_SEC\"" sh ".workflow/scan_with_ollama.sh \"$TEXT_FILES_FILE\" \"$SCAN_JSON_FILE\" \"$OLLAMA_MODEL\" \"$MAX_FILE_BYTES\" \"$REQUEST_TIMEOUT_SEC\""
archiveArtifacts artifacts: "$SCAN_JSON_FILE", allowEmptyArchive: true archiveArtifacts artifacts: "$SCAN_JSON_FILE", allowEmptyArchive: true
@@ -94,7 +94,7 @@ pipeline {
} }
stage('Build Markdown Report') { stage('Build Markdown Report') {
when { expression { fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } } when { branch 'Security' && expression { fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
steps { steps {
sh ".workflow/build_markdown_report.sh \"$SCAN_JSON_FILE\" \"$REPORT_FILE\"" sh ".workflow/build_markdown_report.sh \"$SCAN_JSON_FILE\" \"$REPORT_FILE\""
archiveArtifacts artifacts: "$REPORT_FILE", allowEmptyArchive: true archiveArtifacts artifacts: "$REPORT_FILE", allowEmptyArchive: true
@@ -102,14 +102,14 @@ pipeline {
} }
stage('Report to Gitea (Issue)') { stage('Report to Gitea (Issue)') {
when { expression { fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } } when { branch 'Security' && expression { fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
steps { steps {
sh ".workflow/create_gitea_issue.sh \"$REPORT_FILE\"" sh ".workflow/create_gitea_issue.sh \"$REPORT_FILE\""
} }
} }
stage('Quality Gate') { stage('Quality Gate') {
when { expression { fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } } when { branch 'Security' && expression { fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
steps { steps {
sh ".workflow/evaluate_threshold.sh \"$SCAN_JSON_FILE\" \"$FAIL_ON_MEDIUM_OR_HIGH\"" sh ".workflow/evaluate_threshold.sh \"$SCAN_JSON_FILE\" \"$FAIL_ON_MEDIUM_OR_HIGH\""
} }