From 71bc3688dc95273f7acf13930db953f1cea0042a Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Pla Date: Wed, 15 Apr 2026 11:22:57 +0200 Subject: [PATCH 1/8] Add Jenkins pipeline for SUSE image health check --- ...nkinsfile_mlm_51_ai_registry_health_status | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status diff --git a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status new file mode 100644 index 000000000..1aacc2578 --- /dev/null +++ b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status @@ -0,0 +1,54 @@ +pipeline { + agent any + + environment { + // The URL of the image repository page + TARGET_URL = "https://registry.suse.com/repositories/suse-agentic-mcp-multi-linux-manager" + } + + stages { + stage('Check SUSE Image Health') { + steps { + script { + echo "Checking Health Index for: ${env.TARGET_URL}" + + /** + * The Shell Script Logic: + * 1. curl -sL: Fetch page silently, follow redirects. + * 2. -H "User-Agent...": Mimic a browser to avoid being blocked. + * 3. grep -oP 'grade-\K[A-Z]': Look for 'grade-X' and return only 'X'. + * 4. head -1: Ensure we only get the first match (usually the main badge). + */ + def healthGrade = sh( + script: """ + curl -sL -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)" "${env.TARGET_URL}" | \ + grep -oP 'grade-\\K[A-Z]' | \ + head -1 + """, + returnStdout: true + ).trim() + + if (!healthGrade) { + error "FAIL: Could not find the Health Index on the page. The site layout might have changed." + } + + echo "Detected Health Grade: ${healthGrade}" + + if (healthGrade == 'A') { + echo "SUCCESS: Image is healthy (Grade A)." + } else { + // This will stop the pipeline and mark it as 'Failure' + error "FAIL: Image health is '${healthGrade}'. Pipeline stopped for security reasons." + } + } + } + } + + } + + post { + always { + echo "Finished Health Check." + } + } +} From c2b2bd2bf9307b794be16a4b0a28eaa8971a0961 Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Pla Date: Wed, 15 Apr 2026 11:24:46 +0200 Subject: [PATCH 2/8] Add daily cron trigger to Jenkins pipeline Added a cron trigger to schedule the pipeline execution daily. --- .../mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status index 1aacc2578..3cd6b4576 100644 --- a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status +++ b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status @@ -1,6 +1,11 @@ pipeline { agent any + triggers { + // 'H H * * *' tells Jenkins to pick a random time once a day + // This is better for server performance than '0 0 * * *' + cron('H H * * *') + } environment { // The URL of the image repository page TARGET_URL = "https://registry.suse.com/repositories/suse-agentic-mcp-multi-linux-manager" From 6cc0ef3d72274d737680bb6ed90b025b4c455894 Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Pla Date: Wed, 15 Apr 2026 11:54:10 +0200 Subject: [PATCH 3/8] Update jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status index 3cd6b4576..832630762 100644 --- a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status +++ b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status @@ -1,5 +1,7 @@ pipeline { - agent any + agent { + label 'sumaform-cucumber' + } triggers { // 'H H * * *' tells Jenkins to pick a random time once a day From df83eb713972fb174725e83d4686e64d6c29feba Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Pla Date: Wed, 15 Apr 2026 11:54:26 +0200 Subject: [PATCH 4/8] Update jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status index 832630762..b4b6357db 100644 --- a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status +++ b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status @@ -3,6 +3,10 @@ pipeline { label 'sumaform-cucumber' } + options { + timestamps() + timeout(time: 10, unit: 'MINUTES') + } triggers { // 'H H * * *' tells Jenkins to pick a random time once a day // This is better for server performance than '0 0 * * *' From f1bcb8d1fcb0ca0ce3671428e0866b457bf1e1ca Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Pla Date: Wed, 15 Apr 2026 11:54:56 +0200 Subject: [PATCH 5/8] Update jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Jenkinsfile_mlm_51_ai_registry_health_status | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status index b4b6357db..e2b5aa20f 100644 --- a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status +++ b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status @@ -25,15 +25,18 @@ pipeline { /** * The Shell Script Logic: - * 1. curl -sL: Fetch page silently, follow redirects. - * 2. -H "User-Agent...": Mimic a browser to avoid being blocked. - * 3. grep -oP 'grade-\K[A-Z]': Look for 'grade-X' and return only 'X'. - * 4. head -1: Ensure we only get the first match (usually the main badge). + * 1. set -o pipefail: Fail the pipeline if any command in it fails. + * 2. curl -sL: Fetch page silently, follow redirects. + * 3. -H "User-Agent...": Mimic a browser to avoid being blocked. + * 4. grep -oE 'grade-[A-Z]' | sed 's/grade-//': Look for 'grade-X' and return only 'X' using portable tools. + * 5. head -1: Ensure we only get the first match (usually the main badge). */ def healthGrade = sh( script: """ + set -o pipefail curl -sL -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)" "${env.TARGET_URL}" | \ - grep -oP 'grade-\\K[A-Z]' | \ + grep -oE 'grade-[A-Z]' | \ + sed 's/grade-//' | \ head -1 """, returnStdout: true From 7a2e845f2a443ef20e716a80c4c7fd0d77fbd17f Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Pla Date: Wed, 15 Apr 2026 12:11:17 +0200 Subject: [PATCH 6/8] Update jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status index e2b5aa20f..636c829c7 100644 --- a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status +++ b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status @@ -32,7 +32,7 @@ pipeline { * 5. head -1: Ensure we only get the first match (usually the main badge). */ def healthGrade = sh( - script: """ + script: """#!/usr/bin/env bash set -o pipefail curl -sL -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)" "${env.TARGET_URL}" | \ grep -oE 'grade-[A-Z]' | \ From 968b2d2129a7c5f0a0bdc4c11efbf5e64442499c Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Pla Date: Wed, 15 Apr 2026 12:11:55 +0200 Subject: [PATCH 7/8] Update jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status index 636c829c7..8e917b216 100644 --- a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status +++ b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status @@ -52,7 +52,7 @@ pipeline { echo "SUCCESS: Image is healthy (Grade A)." } else { // This will stop the pipeline and mark it as 'Failure' - error "FAIL: Image health is '${healthGrade}'. Pipeline stopped for security reasons." + error "FAIL: Image health check did not meet the required threshold. Detected grade: '${healthGrade}'. URL: ${env.TARGET_URL}" } } } From 9f6d8802c6faee88c3f9c5effbb0f1c69f650e3d Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Pla Date: Wed, 15 Apr 2026 12:45:10 +0200 Subject: [PATCH 8/8] Update jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status index 8e917b216..9855925b9 100644 --- a/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status +++ b/jenkins_pipelines/mlm_ai/Jenkinsfile_mlm_51_ai_registry_health_status @@ -14,7 +14,7 @@ pipeline { } environment { // The URL of the image repository page - TARGET_URL = "https://registry.suse.com/repositories/suse-agentic-mcp-multi-linux-manager" + TARGET_URL = 'https://registry.suse.com/repositories/suse-agentic-mcp-multi-linux-manager' } stages {