From fdd336fe6eaa1e23fa2d7955c8254699f197aaa8 Mon Sep 17 00:00:00 2001 From: Martin Tahiraj Date: Thu, 2 Apr 2026 15:48:37 +0200 Subject: [PATCH] feat(ci): improve pipelineEvent with dynamic title, context and results - context: 'ha-addons_build' - title: 'Build degli addon HA: : Completato/Fallito' - results: mappa addon {status, available, file} derivata da buildMap Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- ci/Jenkinsfile | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index fed8437..bc6d3be 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -418,12 +418,26 @@ pipeline { } } - // Notifica via shared-lib pipelineEvent (se disponibile) + // Notifica via shared-lib pipelineEvent → Redis Stream try { + def finalStatus = currentBuild.result ?: 'SUCCESS' + def addonNames = addons.isEmpty() ? 'nessun addon' : addons.join(', ') + def outcomeWord = (finalStatus == 'SUCCESS') ? 'Completato' : 'Fallito' + + def evResults = buildMap.collectEntries { addon, info -> + def isOk = (info.status == 'OK') + [(addon): [ + status: isOk ? 'done' : 'failed', + available: isOk, + file: isOk ? "${env.REGISTRY}/hassio-addons/${addon}:${info.version}" : null, + ]] + } + pipelineEvent( - title: 'HA Add-ons CI', - context: 'Build & Push', - status: currentBuild.result ?: 'SUCCESS', + title: "Build degli addon HA: ${addonNames}: ${outcomeWord}", + context: 'ha-addons_build', + status: finalStatus, + results: evResults, ) } catch (e) { echo "[WARN] pipelineEvent fallito: ${e.message}"