From 5fc3febacdb0be25f522f17fb3cd68acb8906a4a Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 26 Nov 2021 15:05:21 +0100 Subject: [PATCH 1/4] add check on component name: if it is maven-parent then skip --- Jenkinsfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6f27c82..fd9565d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -76,11 +76,13 @@ pipeline { steps { script { for (int i = 0; i < components.size(); i++) { - stage(components[i]['name']) { - appendHeading(components[i]['name'], components[i]['version'],components[i]['gitRepo'], components[i]['commitID']) - createNotes(components[i]['name'], components[i]['gitRepo'], + if(components[ i] != "maven-parent"){ + stage(components[i]['name']) { + appendHeading(components[i]['name'], components[i]['version'],components[i]['gitRepo'], components[i]['commitID']) + createNotes(components[i]['name'], components[i]['gitRepo'], params.use_report_commits? components[i]['commitID']:null, components[i]['version'], gCube_release_version) - } + } + } } appendFooter() } -- 2.17.1 From 8ad58c17ccef2669e7adccb97c533d108a1425c8 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 26 Nov 2021 15:21:41 +0100 Subject: [PATCH 2/4] fix check on maven-parent component --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fd9565d..dfe8430 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -76,7 +76,7 @@ pipeline { steps { script { for (int i = 0; i < components.size(); i++) { - if(components[ i] != "maven-parent"){ + if(components[i]['name'] != 'maven-parent'){ stage(components[i]['name']) { appendHeading(components[i]['name'], components[i]['version'],components[i]['gitRepo'], components[i]['commitID']) createNotes(components[i]['name'], components[i]['gitRepo'], -- 2.17.1 From 985ada5740bc5deae016e1ec9b493f6e771942e0 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 26 Nov 2021 15:51:36 +0100 Subject: [PATCH 3/4] add new checkbox input parameter: add_maven_parent --- Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index dfe8430..d3f2504 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -58,6 +58,11 @@ pipeline { booleanParam(name: 'use_report_commits', defaultValue: true, description: 'Use the commits on the report or the latest is on master?') + + booleanParam(name: 'add_maven_parent', + defaultValue: false, + description: 'Set to true if the maven-parent must be added to the notes') + } @@ -76,7 +81,7 @@ pipeline { steps { script { for (int i = 0; i < components.size(); i++) { - if(components[i]['name'] != 'maven-parent'){ + if((components[i]['name'] != 'maven-parent') || (add_maven_parent)){ stage(components[i]['name']) { appendHeading(components[i]['name'], components[i]['version'],components[i]['gitRepo'], components[i]['commitID']) createNotes(components[i]['name'], components[i]['gitRepo'], -- 2.17.1 From 67098f8aad956d78cd442f29f5447535cb19a4af Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 26 Nov 2021 15:59:33 +0100 Subject: [PATCH 4/4] fix boolean condition on maven-parent --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d3f2504..9653149 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,7 +61,7 @@ pipeline { booleanParam(name: 'add_maven_parent', defaultValue: false, - description: 'Set to true if the maven-parent must be added to the notes') + description: 'Set to true only if the maven-parent must be added to the notes') } @@ -81,7 +81,7 @@ pipeline { steps { script { for (int i = 0; i < components.size(); i++) { - if((components[i]['name'] != 'maven-parent') || (add_maven_parent)){ + if((components[i]['name'] != 'maven-parent') || (params.add_maven_parent)){ stage(components[i]['name']) { appendHeading(components[i]['name'], components[i]['version'],components[i]['gitRepo'], components[i]['commitID']) createNotes(components[i]['name'], components[i]['gitRepo'], -- 2.17.1