From 35549617ce19c252dec99872e3ff967a68352217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=8C=AF=E5=AE=87?= <> Date: Mon, 10 Feb 2025 07:35:11 +0800 Subject: [PATCH] fix(pipeline): replace parallel execution with sequential logging for component stages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 孙振宇 <> --- .../freeleaps/devops/SemanticReleasingExecutor.groovy | 1 + .../vars/executeFreeleapsPipeline.groovy | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy index 86ea92c1..73bb8d81 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy @@ -35,6 +35,7 @@ class SemanticReleasingExecutor { steps.sh "semantic-release" steps.log.info("SemanticReleasingExecutor", "Semantic release completed, read latest version from VERSION file") steps.env.LATEST_VERSION = steps.readFile('VERSION').trim() + steps.env.SEMANTIC_RELEASED = true } } } diff --git a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy index e2592a86..97ea27c2 100644 --- a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy +++ b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy @@ -263,6 +263,11 @@ def generateComponentStages(component, configurations) { if (component.semanticReleaseEnabled != null && component.semanticReleaseEnabled) { log.info("Pipeline", "Semantic releasing has enabled, releasing...") + if (env.SEMANTIC_RELEASED != null && !env.SEMANTIC_RELEASED.isEmpty() && env.SEMANTIC_RELEASED) { + log.info("Pipeline", "Semantic release has been executed, skipping...") + return + } + def sourceFetcher = new SourceFetcher(this) sourceFetcher.fetch(configurations) @@ -559,7 +564,10 @@ spec: def componentStages = configurations.components.collectEntries { component -> ["Generated Stage :: ${component.name}": generateComponentStages(component, configurations)] } - parallel componentStages + for (stage in componentStages) { + log.info("Pipeline", "Executing ${stage.key}...") + stage.value() + } } } }