Template
Jenkinsfile: reduced logic for branch security
This commit is contained in:
Vendored
+12
-4
@@ -96,7 +96,9 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Scan with Ollama') {
|
stage('Scan with Ollama') {
|
||||||
when { expression { branch 'Security' && fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
|
when {
|
||||||
|
branch 'Security'
|
||||||
|
}
|
||||||
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
|
||||||
@@ -104,7 +106,9 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Build Markdown Report') {
|
stage('Build Markdown Report') {
|
||||||
when { expression { branch 'Security' && fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
|
when {
|
||||||
|
branch 'Security'
|
||||||
|
}
|
||||||
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
|
||||||
@@ -112,14 +116,18 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Report to Gitea (Issue)') {
|
stage('Report to Gitea (Issue)') {
|
||||||
when { expression { branch 'Security' && fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
|
when {
|
||||||
|
branch 'Security'
|
||||||
|
}
|
||||||
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 { branch 'Security' && fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
|
when {
|
||||||
|
branch 'Security'
|
||||||
|
}
|
||||||
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\""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user